iOS SDK Development (Pragmatic Programmers)
Chris Adamson, Bill Dudney
Welcome to the new state of the art development for iOS, with the radically overhauled Xcode 4 toolchain and iOS 5 SDK. With this book you'll accelerate your development for iPhone, iPad and iPod Touch. You will learn the new tools like Storyboards, practice on new APIs like the Twitter framework and use the latest features of the Objective-C 2.0 programming language.
Since the iPhone's launch in 2008, the iOS platform has added two new device families, thousands of new APIs, new tools and programming practices, and hundreds of thousands of new apps. iOS SDK Development is the second edition of the bestselling iPhone SDK Development, completely rewritten from the ground up to cover iOS 5's new features.
You'll get hands-on experience working with Objective-C and Xcode 4 as you work through this tutorial-style book with two experienced iOS developers by your side. Along the way, you'll learn the fundamentals of maintainable, performant iOS programming, including:
Making apps that are multi-core-capable, testable, internationalizable, and that use less memory.
Understanding the underlying concepts of touch event handling, drawing and animation, multi-core concurrency, and memory management with iOS 5's new Automatic Reference Counting.
Creating and using unit tests to ensure your app continues to work as intended even as the codebase evolves.
Working through Apple's App Store processes, including preparing apps for submission, avoiding rejections, and understanding crash reports from end users.
Whether you're a first-time iOS developer, or you're looking to get up to speed with all the changes to Apple's tools and frameworks, iPhone SDK Development is the solid grounding you need to master this popular platform.
What You Need:
You need a Mac running Mac OS X Lion (10.7) and Xcode 4.
default language, SKU number, and bundle ID (which is the reverse-domain name part of the App ID we set up on the Portal). If the name is already in use, we’ll be returned to this screen and asked to pick another. For example, while taking screenshots for this chapter, we found that “Recipes” was taken (not a surprise, really), so we had to change the name to “Pragmatic Recipes.” * * * Figure 101. App summary page on iTunes Connect Next, we are asked to set an availability date, which
this, we use the Simulator as we would a real iPhone: tap the Settings button (or use the home button to switch out of the app and launch the Settings app, and then go into the Twitter settings). In Settings, configure a Twitter account with name and password and tap the Sign In button. Once done, double-tap home and switch back to PRPFirstProjectTweeter. This time when you tap the button, the Tweet composer should come up, as seen in Figure 15, Sending a tweet with SLComposeViewController.
connection that this binary file named “Recipes.recipes” is associated with our DocumentRecipes app. If we were to deploy the app to a device and send an email, the recipient would have something very similar. Now the time has come to tap the Open In button. And…nothing happens, a rather disappointing outcome. Since our app delegate class PRPAppDelegate does not implement the application:openURL:sourceApplication:annotation: method, iOS will not switch from Mobile Safari to our app. Let’s go fix
just going to discard the conflict. Not nearly as elegant, but it ensures that we are not leaking files into the user’s iCloud account. Before we can discard the conflicted version, we need to know about it. We learn about conflicts by listening for the UIDocumentStateChangedNotification notification. Add the following statement to the application:didFinishLaunchingWithOptions: method just after opening the document. Documents/DocumentRecipes_08/DocumentRecipes/PRPAppDelegate.m
Since we only want to search iOS 6 documentation, use the Doc Sets menu to turn off all the doc sets other than iOS 6. If this menu isn’t visible, click the magnifying glass in the search field and select Show Find Options. Since we don’t know exactly what we’re looking for, set the match type to Contains. * * * Figure 10. Viewing documentation in Xcode Organizer What are we looking for exactly? Since we want to send a tweet, we can enter tweet as the search term and find some useful