Learn Objective-C on the Mac

Book description

Take your coding skills to the next level with this extensive guide to Objective-C, the native programming language for developing sophisticated software applications for Mac OS X. Objective-C is a powerful, object-oriented extension of C, making this book the perfect follow–up to Dave Mark's bestselling Learn C on the Mac, Mac OS X Edition. Whether you're an experienced C programmer or you're coming from a different language such as C++ or Java, leading Mac experts Mark Dalrymple and Scott Knaster show you how to harness the powers of Objective-C in your applications!

  • A complete course on the basics of Objective-C using Apple's free Xcode tools

  • An introduction to object-oriented programming

  • Comprehensive coverage of inheritance, composition, object initialization, categories, protocols, memory management, and organizing source files

  • A brief tour of Cocoa's foundation framework and AppKit

  • A helpful "learning curve" guide for non-C developers

Table of contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Authors
  6. About the Technical Reviewer
  7. Acknowledgments
  8. Preface
  9. Chapter 1: Hello
    1. Before You Start
    2. Where the Future Was Made Yesterday
    3. What's Coming Up
    4. Summary
  10. Chapter 2: Extensions to C
    1. The Simplest Objective-C Program
    2. Deconstructing Hello Objective-C
    3. Are You the Boolean Type?
    4. Summary
  11. Chapter 3: Introduction to Object-Oriented Programming
    1. It's All Indirection
    2. Using Indirection in Object-Oriented Programming
    3. Time Out for Terminology
    4. OOP in Objective-C
    5. Summary
  12. Chapter 4: Inheritance
    1. Why Use Inheritance?
    2. Inheritance Syntax
    3. How Inheritance Works
    4. Overriding Methods
    5. Summary
  13. Chapter 5: Composition
    1. What Is Composition?
    2. Accessor Methods
    3. Extending CarParts
    4. Composition or Inheritance?
    5. Summary
  14. Chapter 6: Source File Organization
    1. Split Interface and Implementation
    2. Breaking Apart the Car
    3. Using Cross-File Dependencies
    4. Summary
  15. Chapter 7: More About Xcode
    1. Changing the Company Name
    2. Using Editor Tips and Tricks
    3. Writing Your Code with a Little Help from Xcode
    4. Getting Information
    5. Debugging
    6. Cheat Sheet
    7. Summary
  16. Chapter 8: A Quick Tour of the Foundation Kit
    1. Some Useful Types
    2. Stringing Us Along
    3. Mutability
    4. Collection Agency
    5. Family Values
    6. Example: Looking for Files
    7. Summary
  17. Chapter 9: Memory Management
    1. Object Life Cycle
    2. Autorelease
    3. The Rules of Cocoa Memory Management
    4. Summary
  18. Chapter 10: Object Initialization
    1. Allocating Objects
    2. Initializing Objects
    3. Isn't That Convenient?
    4. More Parts Is Parts
    5. Car Cleaning, GC Style
    6. The Designated Initializer
    7. Initializer Rules
    8. Summary
  19. Chapter 11: Properties
    1. Shrinking Property Values
    2. Objecting to Properties
    3. Summary
  20. Chapter 12: Categories
    1. Creating a Category
    2. Splitting an Implementation with Categories
    3. Making Forward References with Categories
    4. Informal Protocols and Delegation Categories
    5. Summary
  21. Chapter 13: Protocols
    1. Formal Protocols
    2. Carbon Copies
    3. Objective-C 2.0 Goodies
    4. Summary
  22. Chapter 14: Introduction to the AppKit
    1. Making the Project
    2. Making the AppController @interface
    3. Interface Builder
    4. Laying Out the User Interface
    5. Making Connections
    6. AppController Implementation
    7. Summary
  23. Chapter 15: File Loading and Saving
    1. Property Lists
    2. Encoding Objects
    3. Summary
  24. Chapter 16: Key-Value Coding
    1. A Starter Project
    2. Introducing KVC
    3. A Path! A Path!
    4. Aggregated Assault
    5. Life's a Batch
    6. The Nils Are Alive
    7. Handling the Unhandled
    8. Summary
  25. Chapter 17: NSPredicate
    1. Creating a Predicate
    2. Fuel Filters
    3. Format Specifiers
    4. Hello Operator, Give Me Number 9
    5. SELF Sufficient
    6. String Operations
    7. Like, Fer Sure
    8. That's All, Folks
  26. Appendix: Coming to Objective-C from Other Languages
    1. Coming from C
    2. Coming from C++
    3. Coming from Java
    4. Coming from BASIC
    5. Coming from Scripting Languages
    6. Summary
  27. Index

Product information

  • Title: Learn Objective-C on the Mac
  • Author(s):
  • Release date: January 2009
  • Publisher(s): Apress
  • ISBN: 9781430218159