More iOS 6 Development: Further Explorations of the iOS SDK
Jeff LaMarche, Alex Horovitz
Interested in iPhone and iPad apps development? Want to learn more? Whether you’re a self-taught iPhone and iPad apps development genius or have just made your way through the pages of Beginning iOS 6 Development, we have the perfect book for you.
More iOS 6 Development: Further Explorations of the iOS SDK digs deeper into Apple’s latest iOS 6 SDK. Bestselling authors Dave Mark, Alex Horovitz, Kevin Kim and Jeff LaMarche explain concepts as only they can―covering topics like Core Data, peer-to-peer networking using GameKit and network streams, working with data from the web, MapKit, in-application e-mail, and more. All the concepts and APIs are clearly presented with code snippets you can customize and use, as you like, in your own apps.
If you are going to write a professional iPhone or iPad app, you’ll want to get your arms around Core Data, and there’s no better place to do so than in the pages of this book. The book continues right where Beginning iOS 6 Development leaves off, with a series of chapters devoted to Core Data, the standard for Apple persistence. Dave, Alex, Kevin and Jeff carefully step through each Core Data concept and show techniques and tips specifically for writing larger apps―offering a breadth of coverage you won't find anywhere else.
The Core Data coverage alone is worth the price of admission. But there's so much more! More iOS 6 Development covers a variety of networking mechanisms, from GameKit’s relatively simple BlueTooth peer-to-peer model, to the addition of Bonjour discovery and network streams, through the complexity of accessing files via the web.
Dave, Alex, Kevin, and Jeff will also take you through coverage of concurrent programming and some advanced techniques for debugging your applications. The enhanced multitasking, threading, memory management and more are important. Apps are getting more and more complex, including sophisticated game apps that offer virtual or augmented reality experiences and new mapping views that take advantage of sensors and other APIs in the newest iOS 6 SDK.
Whether you are a relative newcomer to iPhone and iPad or iOS development or an old hand looking to expand your horizons, there’s something for everyone in More iOS 6 Development.
view controllers, select it. In the Attributes Inspector, give it the identifier HeroDetailSegue (Figure 4-21). CHAPrER 4: TIle Devil In tile Detail View 105 Storyboard Segue Iden ifier HeroDetailSeguc Sty e Pus ~-==~ : ) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _- - J Figure 4-21. Setting the segue identifier Now you need to reconnect the HeroListController cells to the HeroDetailSegue. Edit HeroListController .m. Find the method tableView:didSelectRowAtIndexPath: and replace the method
SuperDB.storyboard, and select the first table view cell in the HeroDetailController. Open the Identity Inspector and change the Class field to SuperDBEditCell. Switch to the Attributes Inspector, and change the Style to Custom. Repeat this for the three other table view cells. Open HeroDetailController •m. Add this #import #import "SuperDBEditCell.h" as the second #import directive. Then find tableView: cellForRowAtIndexPath: and edit it to read static NSString *CellIdentifier =
Now type Super Cat, and tap Save. You should exit editing mode, and your hero's new identity should read Super Cat. Tap on Back to return to the list view. Wait. What happened? You renamed your hero Super Cat, but the list view still shows Unknown Hero. If you click on the Unknown Hero row, the detail view also still shows Unknown Hero. Why weren't your changes saved? 114 CHAPTER 4: The DavU In tile Detail VIew Remember when you added the Save button to the detail view? You also added a
conform to the protocols UIPickerViewDataSource and UIPickerViewDelegate. Rather than having a callback on the pickerView to indicate when the picker value has changed, you use the delegate method pickerView:didSelectRow:. Since you're storing the value as a string, you don't need to override the implementation of the value accessor method. However, you do need to override the value mutator. You need to tell the application to use this new class for the Sex attribute. Edit the class row in the
your own error domain for your application using a reverse DNS-style string and assigned that to the constant kHeroValidationDomain. You'll use that domain for any error created as a result of validating the Hero object. You could also have chosen to create a single domain for the entire SuperDB application, but by being more specific, your application will be easier to debug. By creating your own error domains, you can be as specific as you want to be. You also avoid the problem of searching