List of Figures

Chapter 1. Introducing the iPhone and iPad

Figure 1.1. The iPad and iPhone compared side by side. The primary difference between the two—the available screen real estate—is readily apparent.

Figure 1.2. iPad screen area compared to iPhone screen area. Native iPhone apps that aren’t upgraded to run on the iPad appear in the center of the iPad screen.

Figure 1.3. This book’s webpage as shown in Mobile Safari on the iPad. The simplified navigation maximizes the usable viewing area.

Chapter 2. Learning Objective-C and the iPhone OS SDK

Figure 2.1. Clicking iPhone SDK starts your installation.

Figure 2.2. The SDK includes Xcode (left), Interface Builder (center), iPad Simulator (not shown), and the iPhone Simulator (right).

Figure 2.3. Headers and source code files contain distinctive parts of your Objective-C classes.

Figure 2.4. Apple provides you with four layers of frameworks to use when writing iPhone SDK programs.

Figure 2.5. This hierarchy graph shows just a small selection of the classes available in the iPhone OS.

Figure 2.6. A window contains one or more view controllers or views under the iPhone OS.

Chapter 3. Using Xcode

Figure 3.1. Xcode’s main project window shows all your files and allows you to quickly view them.

Figure 3.2. Hello, World! is easy to program on the iPhone using the SDK.

Figure 3.3. Hello, World! on the iPad

Figure 3.4. A brand-new class makes it easy to display a URL and call it up on the screen. You’ve created the first step in building a web browser.

Figure 3.5. By using the appropriate template, you can lay out a nav bar (left), a tab bar (middle), or a flipside function (right) before you start writing any code.

Chapter 4. Using Interface Builder

Figure 4.1. The nib document window (middle top) and the main display window (middle bottom) are two of the fundamental displays in Interface Builder. The Library (right) also comes up when you start Interface Builder. You need to call up the inspector (left) by hand.

Figure 4.2. Using outlets and events, you can export Interface Builder information to different parts of your Xcode.

Figure 4.3. A few seconds of work results in three objects ready for use in Interface Builder, here shown with an iPhone view.

Figure 4.4. The Attributes tab shows all of an item’s basic information.

Figure 4.5. You can change an object’s position and size from the Size tab.

Figure 4.6. The Identity tab contains some deeper stuff that’s mostly beyond the needs of this simple example program.

Figure 4.7. Combining graphics and text can be hard in some programming languages, but under the SDK it can be done entirely with Interface Builder. Here you see a background image with a text overlay.

Figure 4.8. You need to drag and release to build a connection in Interface Builder.

Figure 4.9. You can Ctrl-click to access Connections panels if you want to see multiple connections at the same time.

Figure 4.10. An image, a label, and a dynamic web view are put together in Interface Builder with only a single line of Xcode required (plus a couple of declarations). This shows how simple it is to build a sophisticated interface with little work by using Interface Builder.

Chapter 5. Creating basic view controllers

Figure 5.1. A bare view controller shows view controlling at its simplest: it sits below one object and above another.

Figure 5.2. To hook up a new .xib file to a view controller, enter its name in the view controller’s attributes under NIB Name.

Figure 5.3. IB graphically depicts exactly what autoresizing looks like.

Figure 5.4. A table view controller controls a table view and its collection of cells.

Figure 5.5. A look at the connections automatically created for a controller’s table view

Figure 5.6. Section headers can improve the usability of table views. Here they’re shown in use on both the iPad and iPhone.

Chapter 6. Monitoring events and actions

Figure 6.1. Events are initially sent to the first responder but then travel up the responder chain until they’re accepted.

Figure 6.2. UIEvent objects contain a set of related UITouch objects.

Figure 6.3. Two UITextFields (one of them hidden) and one UILabel, set against an aluminum-colored background on the iPhone, complete the object creation you need for your eventreporter project.

Figure 6.4. Working primarily in Interface Builder, you connect six objects that you’ll use to report events.

Figure 6.5. Your event responder uses a few graphical elements to report events as they occur.

Figure 6.6. UIControl objects take standard touch events and turn them into actions that are dispatched by UIApplication.

Figure 6.7. With an IBAction, there’s no code, just a link.

Figure 6.8. A heavily connected view controller will be a pretty normal sight as you gain experience in creating objects in Interface Builder.

Figure 6.9. A text field and a slider conspire to set the color of the iPhone’s background.

Chapter 7. Creating advanced view controllers

Figure 7.1. A collection of six objects (at minimum) is required to create a functioning tab bar view controller.

Figure 7.2. Dragging a tab bar controller to the nib display window creates the tab bar interface.

Figure 7.3. You can customize tab bars to make navigation clear and simple.

Figure 7.4. A navigation controller contains at least four objects and may be built into a complex web of interconnections.

Figure 7.5. The Navigation-Based Application template contains two .xib files: one for the main view (left) and one for what appears inside the controller (right).

Figure 7.6. The navigation controller shown on both the iPad and iPhone

Figure 7.7. With a few simple commands, a navigation controller’s setup is largely automated. Here you see the titled navigation bar with a titled Back button.

Figure 7.8. Several objects are created in a flipside controller.

Figure 7.9. Objects in Interface Builder can connect to a variety of different files.

Figure 7.10. Creating a split view–based application

Figure 7.11. The bookmarks application employing a split view

Figure 7.12. SplitViewController view elements in Interface Builder

Figure 7.13. A first look at your bookmark application as shown on an iPad in landscape orientation

Figure 7.14. A popover view

Chapter 8. Data: actions, preferences, and files

Figure 8.1. This preferences page was built from scratch on the backside of a flipside controller.

Figure 8.2. This look at system settings reveals some of Root.plist’s PreferenceSpecifiers in the lower-right pane.

Figure 8.3. This display shows how a PSTitleValueSpecifier and a PSMultiValueSpecifier look in Xcode.

Figure 8.4. As seen on an iPhone, in order from top to bottom, a Group, a TextField, another Group, a Switch, a TitleValue, a MultiValue, a ChildPane, a third Group, and a Slider

Figure 8.5. Compiled programs contain several directories full of files.

Figure 8.6. The filesaver application with the keyboard activated on both the iPhone and the iPad

Chapter 9. Data: advanced techniques

Figure 9.1. This menu was created directly from a database.

Figure 9.2. As shown here on the iPhone, the Address Book framework gives you low-level access to contact information.

Figure 9.3. A people picker view controller shown on both the iPad and iPhone

Figure 9.4. Entry box

Figure 9.5. Properties of an Entry

Figure 9.6. Creating a managed object class

Chapter 10. Positioning: accelerometers, location, and the compass

Figure 10.1. The accelerometers measure acceleration in three-dimensional space.

Figure 10.2. Gravity test as shown on the iPad. The ball falls as if pulled by gravity and responds accordingly to changes in the orientation of the device.

Figure 10.3. The Accelerometer Graph shows movement in all three directions.

Figure 10.4. This simple utility shows off locations and distance.

Figure 10.5. An altitude program measures how high you’ve climbed on a mountain of your choice.

Chapter 11. Media: images and the camera

Figure 11.1. Images can be shown in UIImageViews or in UIViews.

Figure 11.2. The image picker is another preprogrammed controller for your use.

Figure 11.3. The collager displays many photos simultaneously.

Chapter 12. Media: audio and recording

Figure 12.1. The MPMediaPickerController

Figure 12.2. A simple media player interface

Figure 12.3. The talkback interface: a simple record/playback application

Chapter 13. Graphics: Quartz, Core Animation, and OpenGL

Figure 13.1. The iPhone does abstract art.

Figure 13.2. As these variant transformations show, order matters. The left picture is untransformed, the middle one is translated and then rotated, and the right one is rotated and then translated.

Figure 13.3. An example of a clipping path in use. The unclipped image is on the left, and the clipped image is on the right.

Figure 13.4. You can change a UIImage without showing it to the user.

Figure 13.5. PhotoDraw can place drawings on pictures.

Figure 13.6. A jet moves across the screen on an iPhone, thanks to Core Animation.

Chapter 14. The web: web views and internet protocols

Figure 14.1. Internet protocols are arranged in a hierarchy.

Figure 14.2. As shown on an iPhone, the thumbnail program removes web views that fail to load.

Figure 14.3. RSS feeds can easily be placed in table views.

Figure 14.4. Complex SDK programs can chain multiple classes.

Figure 14.5. It’s easy to extract data using TouchJSON.

Chapter 15. Peer-to-peer connections using Game Kit

Figure 15.1. The peer-picker interface on both the iPhone and iPad. Using Bluetooth, users can connect to other nearby devices and interact in real time.

Figure 15.2. The GKTennis interface in Interface Builder

Chapter 16. Push notification services

Figure 16.1. Example of a push notification

Figure 16.2. The pushtest icon with a badge count of 2

Figure 16.3. The lifecycle of a push notification

Figure 16.4. Configuring the app to receive push notifications

Figure 16.5. Wizard to create a push certificate

Figure 16.6. Provisioning profile form

Figure 16.7. Converting audio files in the terminal

Figure 16.8. Exporting your Apple developer certificate

Chapter 17. The Map Kit framework

Figure 17.1. Adding an MKMapView to your view

Figure 17.2. Connection Inspector for the MKMapView connections

Figure 17.3. mapTypes: (from left to right) MKMapTypeStandard, MKMapTypeSatellite, MKMapTypeHybrid

Figure 17.4. Reverse geocoder output

Figure 17.5. Annotated map

Figure 17.6. MKMapView with custom annotations

Chapter 18. In-app purchasing using Store Kit

Figure 18.1. Managing users in iTunes Connect

Figure 18.2. In App Purchase Test User

Figure 18.3. The form to add a new test user

Figure 18.4. Choosing Manage Your In App Purchases in iTunes Connect

Figure 18.5. Click the Create New button.

Figure 18.6. Setting up wallpaper product pricing in iTunes Connect

Figure 18.7. Creating a test product name and description in iTunes Connect

Figure 18.8. Your in-app purchase list in iTunes Connect

Figure 18.9. The wallpaper store interface as shown on the iPhone

Figure 18.10. Previewing the product in the wallpaper view

Figure 18.11. A purchase confirmation as shown on the iPhone

Figure 18.12. A successful purchase confirmation as shown on an iPhone

Chapter 19. iPhone SDK enhancements

Figure 19.1. Custom keyboard accessory in the Messages application

Figure 19.2. The sample application with a custom inputAccessoryView, as it appears on an iPad

Figure 19.3. Setting a custom class in the Identity Inspector

Figure 19.4. Replacing the iPad’s keyboard with a UIToolbar

Appendix D. Updating current applications for the iPad

Figure D.1. Upgrading your build target for the iPad

Figure D.2. Info.plist to support multiple interface orientations

Figure D.3. Set the active build target to collage-iPad.

Figure D.4. Collage application running on the iPad

Figure D.5. Broken interface on the iPad

Figure D.6. Updated iPad interface

Figure D.7. The collage application in landscape mode

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset