O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

iOS 7 Programming Fundamentals

Book Description

If you’re getting started with iOS development, or want a firmer grasp of the basics, this practical guide provides a clear view of its fundamental building blocks—Objective-C, Xcode, and Cocoa Touch. You’ll learn object-oriented concepts, understand how to use Apple’s development tools, and discover how Cocoa provides the underlying functionality iOS apps need to have. Dozens of example projects are available at GitHub.

Once you master the fundamentals, you’ll be ready to tackle the details of iOS app development with author Matt Neuburg’s companion guide Programming iOS 7.

  • Explore the C language to learn how Objective-C works
  • Learn how instances are created, and why they’re so important
  • Tour the lifecycle of an Xcode project, from inception to App Store
  • Discover how to build interfaces with nibs and the nib editor
  • Explore Cocoa’s use of Objective-C linguistic features
  • Use Cocoa’s event-driven model and major design patterns
  • Learn the role of accessors, key-value coding, and properties
  • Understand the power of ARC-based object memory management
  • Send messages and data between Cocoa objects


Table of Contents

  1. Preface
    1. Versions
    2. Acknowledgments
    3. From the Programming iOS 4 Preface
    4. Conventions Used in This Book
    5. Using Code Examples
    6. Safari® Books Online
    7. How to Contact Us
  2. I. Language
    1. 1. Just Enough C
      1. Compilation, Statements, and Comments
      2. Variable Declaration, Initialization, and Data Types
      3. Structs
      4. Pointers
      5. Arrays
      6. Operators
      7. Flow Control and Conditions
      8. Functions
      9. Pointer Parameters and the Address Operator
      10. Files
      11. The Standard Library
      12. More Preprocessor Directives
      13. Data Type Qualifiers
    2. 2. Object-Based Programming
      1. Objects
      2. Messages and Methods
      3. Classes and Instances
      4. Class Methods
      5. Instance Variables
      6. The Object-Based Philosophy
    3. 3. Objective-C Objects and Messages
      1. An Object Reference Is a Pointer
        1. Instance References, Initialization, and nil
        2. Instance References and Assignment
        3. Instance References and Memory Management
      2. Methods and Messages
        1. Calling a Method
        2. Declaring a Method
        3. Nesting Method Calls
        4. No Overloading
        5. Parameter Lists
      3. When Message Sending Goes Wrong
        1. Messages to nil
        2. Unrecognized Selectors
      4. Typecasting and the id Type
      5. Messages as Data Type
      6. C Functions
      7. CFTypeRefs
      8. Blocks
    4. 4. Objective-C Classes
      1. Subclass and Superclass
      2. Interface and Implementation
      3. Header File and Implementation File
      4. Class Methods
      5. The Secret Life of Classes
    5. 5. Objective-C Instances
      1. How Instances Are Created
        1. Ready-Made Instances
        2. Instantiation from Scratch
          1. Initialization
          2. The designated initializer
        3. Nib-Based Instantiation
      2. Polymorphism
      3. The Keyword self
      4. The Keyword super
      5. Instance Variables and Accessors
      6. Key–Value Coding
      7. Properties
      8. How to Write an Initializer
      9. Referring to Instances
  3. II. IDE
    1. 6. Anatomy of an Xcode Project
      1. New Project
      2. The Project Window
        1. The Navigator Pane
        2. The Utilities Pane
        3. The Editor
      3. The Project File and Its Dependents
      4. The Target
        1. Build Phases
        2. Build Settings
        3. Configurations
        4. Schemes and Destinations
        5. Renaming Parts of a Project
      5. From Project to Running App
        1. Build Settings
        2. Property List Settings
        3. Nib Files
        4. Additional Resources
        5. Code and the App Launch Process
        6. Frameworks and SDKs
    2. 7. Nib Management
      1. A Tour of the Nib Editor Interface
        1. The Document Outline
        2. Canvas
        3. Inspectors and Libraries
      2. Nib Loading
      3. Outlets and the Nib Owner
        1. Creating an Outlet
        2. Misconfiguring an Outlet
        3. Deleting an Outlet
        4. More Ways to Create Outlets
        5. Outlet Collections
      4. Action Connections
      5. Additional Initialization of Nib-Based Instances
    3. 8. Documentation
      1. The Documentation Window
      2. Class Documentation Pages
      3. Sample Code
      4. Other Resources
        1. Quick Help
        2. Symbols
        3. Header Files
        4. Internet Resources
    4. 9. Life Cycle of a Project
      1. Device Architecture and Conditional Code
      2. Version Control
      3. Editing Your Code
        1. Autocompletion
        2. Snippets
        3. Fix-it and Live Syntax Checking
      4. Navigating Your Code
      5. Running in the Simulator
      6. Debugging
        1. Caveman Debugging
        2. The Xcode Debugger
      7. Unit Testing
      8. Static Analyzer
      9. Clean
      10. Running on a Device
        1. Obtaining a Certificate
        2. Obtaining a Development Provisioning Profile
        3. Running the App
        4. Profile and Device Management
      11. Gauges and Instruments
      12. Localization
      13. Archiving and Distribution
      14. Ad Hoc Distribution
      15. Final App Preparations
        1. Icons in the App
        2. Other Icons
        3. Launch Images
        4. Screenshots
        5. Property List Settings
      16. Submission to the App Store
  4. III. Cocoa
    1. 10. Cocoa Classes
      1. Subclassing
      2. Categories
        1. Splitting a Class
        2. Class Extensions
      3. Protocols
        1. Informal Protocols
        2. Optional Methods
      4. Some Foundation Classes
        1. Useful Structs and Constants
        2. NSString and Friends
        3. NSDate and Friends
        4. NSNumber
        5. NSValue
        6. NSData
        7. Equality and Comparison
        8. NSIndexSet
        9. NSArray and NSMutableArray
        10. NSSet and Friends
        11. NSDictionary and NSMutableDictionary
        12. NSNull
        13. Immutable and Mutable
        14. Property Lists
      5. The Secret Life of NSObject
    2. 11. Cocoa Events
      1. Reasons for Events
      2. Subclassing
      3. Notifications
        1. Receiving a Notification
        2. Unregistering
        3. Posting a Notification
        4. NSTimer
      4. Delegation
        1. Cocoa Delegation
        2. Implementing Delegation
      5. Data Sources
      6. Actions
      7. The Responder Chain
        1. Deferring Responsibility
        2. Nil-Targeted Actions
      8. Swamped by Events
      9. Delayed Performance
    3. 12. Accessors and Memory Management
      1. Accessors
      2. Key–Value Coding
        1. KVC and Outlets
        2. Key Paths
        3. Array Accessors
      3. Memory Management
        1. Principles of Cocoa Memory Management
        2. The Rules of Cocoa Manual Memory Management
        3. What ARC Is and What It Does
        4. How Cocoa Objects Manage Memory
        5. Autorelease
        6. Memory Management of Instance Variables (Non-ARC)
        7. Memory Management of Instance Variables (ARC)
        8. Retain Cycles and Weak References
        9. Unusual Memory Management Situations
        10. Nib Loading and Memory Management
        11. Memory Management of Global Variables
        12. Memory Management of CFTypeRefs
        13. Memory Management of Pointer-to-Void Context Info
      4. Properties
        1. Property Memory Management Policies
        2. Property Declaration Syntax
        3. Property Accessor Synthesis
        4. Dynamic Accessors
    4. 13. Communication Between Objects
      1. Visibility by Instantiation
      2. Visibility by Relationship
      3. Global Visibility
      4. Notifications
      5. Key–Value Observing
      6. Model–View–Controller
  5. Index
  6. About the Author
  7. Colophon
  8. Copyright