Having trouble with the Hour 1 Welcome project? Please download the updated tutorial archive – posted May 6th, 2015. A change in the Swift project templates with the latest version of Xcode prevented the application from running.
Having trouble with the Hour 1 Welcome project? Please download the updated tutorial archive – posted May 6th, 2015. A change in the Swift project templates with the latest version of Xcode prevented the application from running.
Teach Yourself iOS 8 in 24 Hours was written with the latest version of Xcode, and the project files were prepared with the latest beta. Unfortunately, Swift is evolving quickly. There will likely be small issues that occur in the project code as underlying changes are made. In the GPS projects, for example, you’ll see an change to the downcasting in Xcode 6.3 that requires “<blah> as! <blah>
” as opposed to “<blah> as <blah>
.” Xcode 6.2 (the current shipping version at the time of this writing) doesn’t require this.
If you have a difficult time with a piece of code in the book, let me know! I’ll make sure that an update is made available.
Having trouble with the Hour 1 Welcome project on the iPhone? Please download the updated tutorial archive – posted Jan 25, 2014. An error with the project file settings prevented the original release from running correctly.
In the latest Xcode releases you will see an error regarding a missing root View Controller when running the HelloXcode application. To satisfy the requirement, simply add this line to the code provided:
self.window.rootViewController=[UIViewController new];
Table 14.1 is referenced at the end of page 452, but isn’t included in the book. The missing table is reproduced here:
Sick of typing a @synthesize line for every property? Install Xcode 4.4 (now available on the Mac App Store) and let Xcode do it for you!
If you install new versions of Xcode from the App Store, you’ll notice that they no longer install under a “/Developer” directory. Xcode now lives under the main Applications directory. The Developer directory is still present, but it’s just located in the Xcode application bundle at “/Applications/Xcode.app/Contents/Developer/”.
In Xcode 4.3 and later, Apple has changed what happens when you add a navigation controller to your project. Instead of giving you a blank UIViewController (labeled “Root View Controller”) to do with as you please, it links you to a table view controller. The good news is that you can still easily remove this table view controller and connect to whatever type of scene you want.
For example, in the Hour 13 “LetsNavigate” project, after adding the navigation controller, your Storyboard will look like this:
To change back to a “normal” view controller (UIViewController) in place of the table view controller (UITableViewController), follow these steps:
In the most recent versions of Xcode (and future versions), classes such as UIViewController are not available as separate selections when adding a new class to your project. Instead, choose to create a new Objective-C class, then, on the second screen of the assistant, set the subclass to UIViewController (or whatever you need). From that point forward, everything should match up.
Frequently I question Apple’s changes to the UI, but, in this case, the change makes Xcode a bit more consistent.
Thanks to the readers for catching this!
In the process of trying to consolidate examples for this latest edition, I introduced a bug into the Hour 14 “FlowerColorTable” project. To display the flower images in this tutorial, I used the name of the flower as the name of the image file – but I changed the capitalization.
This is a big no-no!
Unlike OS X, the iOS filesystem is case sensitive. OS X is case-aware, but, by default, not case sensitive. As a result, the example ran fine in the iOS simulator (running off the OS X filesystem) but failed to show the flower images when run on a device.
The fix? Make the flower names given in the viewDidLoad method of the view controller match the file names, or vice versa.
Thanks to the readers for catching this!