did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9781449311438

iOS 5 Programming Cookbook

by
  • ISBN13:

    9781449311438

  • ISBN10:

    1449311431

  • Format: Paperback
  • Copyright: 2012-02-15
  • Publisher: Oreilly & Associates Inc
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $49.99 Save up to $1.63
  • Buy New
    $48.49
    Add to Cart Free Shipping Icon Free Shipping

    USUALLY SHIPS IN 2-3 BUSINESS DAYS

Supplemental Materials

What is included with this book?

Summary

With the recipes in this updated cookbook, you'll go beyond theory to solve the vexing, real-life issues you're likely to face when creating apps for the iPhone, iPad, or iPod Touch. Each recipe provides a clear solution and sample code that you can use right away. You'll find solutions for working with development frameworks in iOS SDK 5 and technologies such as Cocoa, Objective-C, Xcode, and Interface Builder. Whether you have a little or a lot of experience with iOS development, you'll find the help you need for every phase of the process, from initial idea to completed project. Work with Objective-C classes, objects, properties, delegates, and memory management Construct a user interface with gesture recognizers Develop location-aware applications with the Map Kit and Core Location APIs Build apps that play audio and video, manage calendars and events, access contacts and groups, or tap into the Photo Library Use the Core Motion framework to access the accelerometer and gyroscope Maintain persistent storage for iOS apps with the Core Data framework Create multitasking-aware apps that let users leave and return without losing their place

Author Biography

Vandad Nahavandipoor has developed software with Cocoa, Cocoa Touch, Assembly, Delphi, and .NET for years. In his work with a global leader in mobile money solutions, he's delivered mobile applications to customers of some of the world's largest brands, including Visa and US Bank.

Table of Contents

Prefacep. xi
The Basicp. 1
Creating a Simple iOS App in Xcodep. 2
Understanding Interface Builderp. 5
Compiling iOS Appsp. 10
Running iOS Apps on the Simulatorp. 12
Running iOS Apps on iOS Devicesp. 13
Packaging iOS Apps for Distributionp. 16
Declaring Variables in Objective-Cp. 21
Allocating and Making Use of Stringsp. 24
Comparing Values in Objective-C with an If Statementp. 28
Implementing Loops with For Statementsp. 31
Implementing While Loopsp. 33
Creating Custom Classesp. 36
Defining Functionality for Classesp. 39
Defining Two or More Methods with the Same Namep. 43
Allocating and Initializing Objectsp. 47
Adding Properties to Classesp. 49
Moving From Manual Reference Counting to Automatic Reference Countingp. 53
Typecasting with Automatic Reference Countingp. 58
Delegating Tasks with Protocolsp. 62
Determining Whether Instance or Class Methods Are Availablep. 68
Determining Whether a Class Is Available at Runtimep. 71
Allocating and Making Use of Numbersp. 72
Allocating and Making Use of Arraysp. 74
Allocating and Making Use of Dictionariesp. 79
Allocating and Making Use of Setsp. 82
Creating Bundlesp. 85
Loading Data From the Main Bundlep. 86
Loading Data From Other Bundlesp. 89
Sending Notifications with NSNotificationCenterp. 92
Listening for Notifications Sent From NSNotificationCenterp. 96
Implementing Controllers and Viewsp. 101
Displaying Alerts with UIAlertViewp. 102
Creating and Using Switches with UISwitchp. 111
Picking Values with UIPickerViewp. 115
Picking the Date and Time with UIDatePickerp. 123
Implementing Range Pickers with UISliderp. 128
Grouping Compact Options with UISegmentedControlp. 133
Presenting and Managing Views with UIViewControllerp. 140
Implementing Navigation with UINavigationControllerp. 144
Manipulating a Navigation Controller's Array of View Controllersp. 151
Displaying an Image on a Navigation Barp. 152
Adding Buttons to Navigation Bars Using UIBarButtonItemp. 153
Presenting Multiple View Controllers with UITabBarControllerp. 162
Displaying Static Text with UILabelp. 169
Accepting User Text Input with UITextFieldp. 174
Displaying Long Lines of Text with UITextViewp. 184
Adding Buttons to the User Interface with UIButtonp. 189
Displaying Images with UIImageViewp. 194
Creating Scrollable Content with UIScrollViewp. 199
Loading Web Pages with UIWebViewp. 204
Presenting Master-Detail Views with UISplitViewControllerp. 209
Enabling Paging with UIPageViewControllerp. 215
Displaying Popovers with UIPopoverControllerp. 220
Displaying Progress with UIProgressViewp. 231
Listening and Reacting to Keyboard Notificationsp. 233
Constructing and Using Table Viewsp. 251
Instantiating a Table Viewp. 251
Assigning a Delegate to a Table Viewp. 254
Populating a Table View with Datap. 255
Receiving and Handling Table View Eventsp. 260
Using Different Types of Accessories in a Table View Cellp. 261
Creating Custom Table View Cell Accessoriesp. 264
Displaying Hierarchical Data in Table Viewsp. 266
Enabling Swipe Deletion of Table View Cellsp. 268
Constructing Headers and Footers in Table Viewsp. 270
Displaying Context Menus on Table Views Cellsp. 281
Moving Cells and Sections in Table Viewsp. 286
Deleting Cells and Sections From Table Viewsp. 294
Storyboardsp. 305
Creating a Project with Storyboardsp. 306
Adding a Navigation Controller to a Storyboardp. 309
Passing Data From One Screen to Anotherp. 319
Adding a Storyboard to an Existing Projectp. 321
Concurrencyp. 325
Constructing Block Objectsp. 331
Accessing Variables in Block Objectsp. 335
Invoking Block Objectsp. 341
Dispatching Tasks to Grand Central Dispatchp. 342
Performing UI-Related Tasks with GCDp. 344
Performing Non-UI Related Tasks Synchronously with GCDp. 348
Performing Non-UI Related Tasks Asynchronously with GCDp. 351
Performing Tasks After a Delay with GCDp. 357
Performing a Task Only Once with GCDp. 360
Grouping Tasks Together with GCDp. 362
Constructing Your Own Dispatch Queues with GCDp. 366
Running Tasks Synchronously with Operationsp. 369
Running Tasks Asynchronously with Operationsp. 375
Creating Dependency Between Operationsp. 382
Creating Timersp. 385
Creating Concurrency with Threadsp. 390
Invoking Background Methodsp. 395
Exiting Threads and Timersp. 396
Core Location and Mapsp. 401
Creating a Map Viewp. 403
Handling the Events of a Map Viewp. 405
Pinpointing the Location of a Devicep. 407
Displaying Pins on a Map Viewp. 410
Displaying Pins with Different Colors on a Map Viewp. 412
Displaying Custom Pins on a Map Viewp. 419
Converting Meaningful Addresses to Longitude and Latitudep. 422
Converting Longitude and Latitude to a Meaningful Addressp. 424
Implementing Gesture Recognizersp. 427
Detecting Swipe Gesturesp. 429
Detecting Rotation Gesturesp. 431
Detecting Panning and Dragging Gesturesp. 435
Detecting Long Press Gesturesp. 437
Detecting Tap Gesturesp. 441
Detecting Pinch Gesturesp. 443
Networking, JSON, XML, and Twitterp. 47
Downloading Asynchronously with NSURLConnectionp. 447
Handling Timeouts in Asynchronous Connectionsp. 450
Downloading Synchronously with NSURLConnectionp. 451
Modifying a URL Request with NSMutableURLRequestp. 454
Sending HTTP GET Requests with NSURLConnectionp. 455
Sending HTTP POST Requests with NSURLConnectionp. 457
Sending HTTP DELETE Requests with NSURLConnectionp. 460
Sending HTTP PUT Requests with NSURLConnectionp. 462
Serializing Arrays and Dictionaries into JSONp. 464
Deserializing JSON into Arrays and Dictionariesp. 467
Integrating Twitter Functionality into Your Appsp. 470
Parsing XML with NSXMLParserp. 477
Audio and Videop. 483
Playing Audio Filesp. 483
Handling Interruptions While Playing Audiop. 485
Recording Audiop. 486
Handling Interruptions While Recording Audiop. 493
Playing Audio Over Other Active Soundsp. 494
Playing Video Filesp. 498
Capturing Thumbnails From a Video Filep. 502
Accessing the Music Libraryp. 505
Address Bookp. 513
Retrieving a Reference to an Address Bookp. 516
Retrieving All the People in the Address Bookp. 518
Retrieving Properties of Address Book Entriesp. 520
Inserting a Person Entry into the Address Bookp. 525
Inserting a Group Entry into the Address Bookp. 528
Adding Persons to Groupsp. 531
Searching the Address Bookp. 534
Retrieving and Setting a Person's Address Book Imagep. 540
Camera and the Photo Libraryp. 547
Detecting and Probing the Camerap. 549
Taking Photos with the Camerap. 554
Taking Videos with the Camerap. 558
Storing Photos in the Photo Libraryp. 561
Storing Videos in the Photo Libraryp. 564
Retrieving Photos and Videos From the Photo Libraryp. 566
Retrieving Assets From the Assets Libraryp. 568
Editing Videos on an iOS Devicep. 575
Multitaskingp. 581
Detecting the Availability of Multitaskingp. 582
Completing a Long-Running Task in the Backgroundp. 583
Receiving Local Notifications in the Backgroundp. 587
Playing Audio in the Backgroundp. 596
Handling Location Changes in the Backgroundp. 598
Saving and Loading the State of Multitasking iOS Appsp. 601
Handling Network Connections in the Backgroundp. 605
Handling Notifications Delivered to a Waking Appp. 608
Responding to Changes in App Settingsp. 610
Opting Out of Multitaskingp. 613
CoreDatap. 615
Creating a Core Data Model with Xcodep. 618
Generating Class Files for Core Data Entitiesp. 622
Creating and Saving Data Using Core Datap. 624
Reading Data From Core Datap. 626
Deleting Data From Core Datap. 629
Sorting Data in Core Datap. 632
Boosting Data Access in Table Viewsp. 634
Implementing Relationships in Core Datap. 646
Dates, Calendars, and Eventsp. 653
Retrieving the List of Calendarsp. 656
Adding Events to Calendarsp. 658
Accessing the Contents of Calendarsp. 662
Removing Events From Calendarsp. 666
Adding Recurring Events to Calendarsp. 670
Retrieving the Attendees of an Eventp. 674
Adding Alarms to Calendarsp. 679
Handling Event Changed Notificationsp. 681
Presenting Event View Controllersp. 684
Presenting Event Edit View Controllersp. 688
Graphic and Animationsp. 693
Enumerating and Loading Fontsp. 702
Drawing Textp. 704
Constructing, Setting, and Using Colorsp. 705
Drawing Imagesp. 711
Drawing Linesp. 716
Constructing Pathsp. 722
Drawing Rectanglesp. 727
Adding Shadows to Shapesp. 731
Drawing Gradientsp. 737
Displacing Shapes Drawn on Graphic Contextsp. 745
Scaling Shapes Drawn on Graphic Contextsp. 749
Rotating Shapes Drawn on Graphic Contextsp. 752
Animating and Moving Viewsp. 753
Animating and Scaling Viewsp. 763
Animating and Rotating Viewsp. 765
Core Motionp. 767
Detecting the Availability of an Accelerometerp. 769
Detecting the Availability of a Gyroscopep. 770
Retrieving Accelerometer Datap. 772
Detecting Shakes on an iOS Devicep. 775
Retrieving Gyroscope Datap. 779
iCIoudp. 781
Setting Up Your App for iCloudp. 782
Storing and Synchronizing Dictionaries in iCloudp. 787
Creating and Managing Folders for Apps in iCloudp. 792
Searching for Files and Folders in iCloudp. 798
Storing User Documents in iCloudp. 807
Managing the State of Documents in iCloudp. 822
Handling Conflicts in iCloud Documentsp. 825
Indexp. 837
Table of Contents provided by Ingram. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program