Head First iPhone and iPad Development and iOS5

By Tracey Pilone
October 14, 2011 | Comments: 11

Well, iOS5 is out, and that means that Head First iPhone and iPad Development officially needs some tweaking to work with the latest tools!

First, a quick overview of the new features in iOS 5. For the OS itself, the biggest change is the addition of iCloud to the storage solutions for apps. Primarily Apple apps are leveraging this ability to support synching at this point, with Photo Stream, iMessage, and iTunes purchasing support, among others, but as time moves on that will expand. Newsstand support has the potential to change the publishing industry by providing a centralized place on the device and method of updating subscription type materials. You can find the Apple summary of these and other features here.

There are lots of other bells and whistles, the new Siri app is a personal assistant app that can parse meaning from verbal messages and find out information for you, but it only really works on the new iPhone 4S. Twitter integration is system wide now, and the new Reminders app is also really cool. It has geo-fencing for tasks, so you can set up a task that says "remember to take my shoes home from work" and when you leave that place, iOS will send you the reminder.

What does iOS5 mean for Xcode? Xcode has two major changes. First, there is now storyboarding support. That means that instead of creating each .xib file and manually linking them together and coding the transitions, you can create a big .storyboard file that contains all of the .xibs for your app and you can graphically edit the transitions between views.

The second big change is that Apple has added ARC (Automatic Reference Counting) to Xcode. A lot of the memory management work that we teach in the book has been automated. While it is stil important to understand what is going on, all the retain/releases that we have so painstakingly put in our code are now handled automatically.

What if you want to use the book with the new Xcode? Just a couple of things that you should know about. First, all the downloaded code here on headfirstlabs.com will still work, no problem. Second, when you create new projects, there are some new checkboxes to be aware of. When the project starts, there are boxes to "Use Storyboard" and "Use Automatic Reference Counting." In order to use our book as it is, you'll need to UNCHECK these two boxes. That's it. If you keep those two things in mind, all the examples in the book will still work without a problem.

One of the things that keeps technology exciting is constant change! Fortunately, these changes are relatively minor as long as you set up the project properly and you'll have happy coding. In the meantime, we're busily working on updating the book, which will be out early next year.


Comments: 11

I just finished chapter 6 and everything went fine until now. I figured out that Navigation-based is now Master-detail and all that, but chapter 7 is about migrating your app to the iPad and when I change the target from iPhone to Universal, Xcode doesn't say anything about using the iPhone interface as a starting point for the iPad one. The picture in the book shows that there's a MainWindows.xib and that it's used as the Main Interface. In Xcode 4.2 (Master-Detail app.) there is no MainWindow.xib and Main Interface option is empty. Do you know how to solve this?

There's no longer a need for a mainWindow.xib file because it is now created programmatically in the appDelegate class in the first line of the application:didFinishLaunchingWithOptions method. The method then instantiates a view controller and loads its .xib file into the main window.

Please update this wonderful book asap !

This is a wonderful book.
Please make a PDF version of the 3rd edition with iOS 5 available (or as a rough cut on safari books online) as soon as possible!

I'm investigating the possibility of using this book as teaching material but it needs to cover iOS5. When you say it will be ready early next year does that mean it will be ready in mid-February?

This is a great book. Best on the market and super easy to follow and say a "yes, I get it"! Updating this to iOS 5 will be huge. I eagerly await the update.

This is such a fun and exciting book!

I am trying to implement the DrinkMixer application using storyboard (xcode 4.2), however I am stuck with the of the sub-classing of the drink detail view controller to create the add drink detail view controller. initWithNibName needs to be replaced with instantiateViewControllerWithIdentifier in order to achieve the instantiation of the sub-classed view controller. However in this case, the viewDidLoad function of the subclass is never called (instead the viewDidLoad function of the superclass is called). I looked all over the internet, but cannot find a solution for this. Please provide an update on this implementation.

Regards
Anton

We're working on the iOS 5 updates now! We'll release as soon as they're ready :-)

Tracey, when?.. =/

Be patient, she just told you......when they are ready

... and when will they ready? :) this month? next? winter? spring? a little bit more info please :)