Xcode 10.12

Xcode 8.3.3: macOS 10.12 osximage: xcode8: Xcode 8.0: macOS 10.11 osximage: xcode7.3: Xcode 7.3.1: macOS 10.11 Detailed iOS SDK versions are available in the macOS CI environment reference. Objective-C vs Swift # Right now, language: swift is just an alias for language: objective-c. Said another way, we don’t have native support for Swift.

I've found the solution. Apperantly this is a general App Store problem applicable to program downloads issues. I used suggestion from this message by bjbesthttps://discussions.apple.com/thread/3118115?answerId=15661563022#15661563022:

All downloads are hosted by Apple. Links on this site take you directly to Apple’s download pages. This is not an official Apple website. Please consider donating to help maintain it. If you perform a fresh install of Xcode, you will also need to add the commandline tools by running xcode-select-install on the terminal. While OS X comes with a large number of Unix utilities, those familiar with Linux systems will notice one key component missing: a package manager. Xcode is a complete developer toolset for creating apps for Mac, iPhone, iPad, Apple Watch, and Apple TV. Xcode brings user interface design, coding, testing, debugging, and submitting to the App Store into a unified workflow. Downloading and updating Xcode. The current release of Xcode is available as a free download from the Mac App Store. Xcode is the tool developers use to build apps for the Apple ecosystem – MacOS, iOS, and all things Apple. This guide will walk you through how to successfully install Xcode onto your Mac, from start to finish. Here are some handy tips to know before you get started: Xcode only.


10.14

1. Open Terminal

2. Enter

3. Relaunch the AppStore

4. Choose the menu item Debug Menu -> Reset App

5. Choose the menu item Debug Menu -> Check for Available Downloads…


and also change DNSs to those of Google's as was also suggested in the thread https://discussions.apple.com/thread/3118115


Hope it helps!


Cheers!

Oct 5, 2012 8:39 AM

Xcode 10.2

In the previous tutorial, you learned about the Core Data stack and the classes involved. In this tutorial, we take a close look at Xcode's template for Core Data applications.

Setting Up the Project

Open Xcode and select New > Project... from the File menu. Choose the Single View Application template from the iOS > Application section and click Next.

Name the application Core Data, enter an organization name and identifier, and set Language to Swift. Check the Use Core Data checkbox to make sure Xcode adds the necessary files and code for working with Core Data.

Exploring Files and Folders

The project includes a file that may be new to you, Core_Data.xcdatamodeld. This is the data model I talked about in the previous tutorial. Select the file to take a quick peek at its contents.

Because the data model doesn't contain any entities yet, there isn't much to see. We take a closer look at the data model and the data model editor in Mastering Core Data With Swift 3.

Xcode 12.2

Exploring the Application Delegate

More interesting is the implementation of the AppDelegate class. Open AppDelegate.swift and take a moment to see what Xcode has added for us when we checked the Use Core Data checkbox during the project setup. The first detail worth noting is the import statement for the Core Data framework at the top.

The other interesting bits are the lazy stored property, persistentContainer, of type NSPersistentContainer and the saveContext() helper method.

Xcode's Core Data template received a dramatic makeover with the release of the NSPersistentContainer class. This class was introduced alongside iOS 10, tvOS 10, macOS 10.12, and watchOS 3. While it greatly simplifies setting up Core Data, it isn't ideal for learning the framework. Why is that?

The NSPersistentContainer class encapsulates the Core Data stack. It is in charge of setting up the Core Data stack and managing the building blocks we discussed in the previous tutorial. This means that we don't have any insight into the inner workings of the NSPersistentContainer class, which makes it difficult to illustrate what we learned about the Core Data stack in the previous tutorial.

Fortunately, the NSPersistentContainer class provides access to the managed object model, the managed object context, and the persistent store coordinator. In Mastering Core Data With Swift 3, we take a different approach by building a Core Data stack from scratch. This teaches you essential insights into the inner workings of the Core Data stack, the heart of every Core Data application. If you are serious about learning and using Core Data, then you should take Mastering Core Data With Swift 3. It also discuss the NSPersistentContainer class in more detail.

Xcode 10.12.6

This is what the lazy property looks like. Comments are omitted for clarity.

The NSPersistentContainer instance is initialized by invoking a convenience initializer, init(name:), passing in the name of the data model, Core_Data. Notice that there is no explicit instantiation of NSManagedObjectModel, NSPersistentStoreCoordinator, or NSManagedObjectContext. This is abstracted away by the NSPersistentContainer class.

A Core Data stack without a persistent store isn't terribly useful. After initializing the persistent container, the persistent store is loaded by invoking the loadPersistentStores(completionHandler:) method. It accepts one parameter, a closure, which is invoked when loading of the persistent store is completed, successfully or unsuccessfully. The closure accepts two parameters, an instance of the NSPersistentStoreDescription class and an optional Error object.

The NSPersistentStoreDescription class is another new addition to the Core Data framework. It encapsulates the information and configuration to add a persistent store to the persistent store coordinator. As the name of the class implies, it describes a persistent store.

What Is a Persistent Container?

As I already mentioned, the NSPersistentContainer class encapsulates the Core Data stack and it is available as of iOS 10, tvOS 10, macOS 10.12, and watchOS 3. It makes setting up a Core Data stack easier than ever, providing developers with a simple setup with some flexibility.

After creating an instance of the NSPersistentContainer class, you can easily access the managed object model and the persistent store coordinator through the managedObjectModel and persistentStoreCoordinator properties.

The class also provides easy access to a viewContext property, an instance of the NSManagedObjectContext class that operates on the main queue. As the name of the property implies, this managed object context is designed to be used in combination with the application's user interface. Main queue? User interface? Don't worry about this for now. We discuss this in more detail in Mastering Core Data With Swift 3.

There are several other neat features, such as the ability to create background managed object contexts and specifying the directory in which the persistent store lives by subclassing NSPersistentContainer. These are more advanced features.

Saving Changes

Xcode Releases

The application template also includes a helper method to save the changes of the managed object context. In this method, we access the managed object context of the persistent container through the viewContext property.

We check if the managed object context has any changes by inspecting the value of the hasChanges property. To save the changes of the managed object context, we invoke save() on the managed object context. Because this method is throwing, we wrap it in a do-catch statement.

Xcode 10.14.6

Xcode 10.12

Refactoring the Core Data Stack

I always try to keep the implementation of the application delegate short and simple. Setting up the Core Data stack is something we could and should move to a dedicated class. This makes the implementation of the AppDelegate class shorter and less cluttered. This is something we discuss in detail in Mastering Core Data With Swift.

Questions? Leave them in the comments below or reach out to me on Twitter. You can download the source files for this article from GitHub.

Now that you know what Core Data is and how the Core Data stack is set up, it's time to write some code. If you're serious about Core Data, check out Mastering Core Data With Swift. We build an application that is powered by Core Data and you learn everything you need to know to use Core Data in your own projects.