Home Page Icon
Home Page
Table of Contents for
Part II: Working with the Objective-C Basics
Close
Part II: Working with the Objective-C Basics
by Jesse Feiler
Sams Teach Yourself Objective-C in 24 Hours, Second Edition
About This eBook
Title Page
Copyright Page
Contents at a Glance
Table of Contents
About the Author
Acknowledgments
We Want to Hear from You!
Reader Services
Introduction
Who Should Read This Book
What This Book Covers
Downloading the Sample Files
How This Book Is Organized
Part I: Getting Started with Objective-C
Hour 1. Overview of the Developer Program
Introducing Objective-C
Enrolling as an Apple Developer
Choosing Your Program
Setting Up the Development Environment
Summary
Q&A
Workshop
Hour 2. Object-Oriented Programming with Objective-C
Object-Oriented Programming in the Objective-C World
Creating C with Objects
Managing Inheritance in the Objective-C World
Summary
Q&A
Workshop
Hour 3. Using Object-Oriented Features in Objective-C
Communicating to Methods with Messages
Allocating and Initializing Objects
Summary
Q&A
Workshop
Hour 4. Using Xcode 5
Getting to Work with Xcode
Keeping Track of Your Source Code
Using a Remote Repository
Summary
Q&A
Workshop
Hour 5. Using Compiler Directives
Exploring Your Projects
Working with Compiler Directives
Using Objective-C Compiler Directives
Summary
Q&A
Workshop
Part II: Working with the Objective-C Basics
Hour 6. Exploring Messaging and a Testbed App
Setting Up the Testbed Apps
Adding a Text Field and Connecting It to Your Code
Sending a Message to the Text Field
Reviewing the Message Syntax
Summary
Q&A
Workshop
Hour 7. Declaring a Class in an Interface File
Letting Xcode Do the Work
Exploring Class Hierarchies
Declaring Classes
Summary
Q&A
Workshop
Hour 8. Declaring Instance Variables in an Interface File
Declaring Instance Variables and Properties
Using the Class
Creating an Instance Variable for CurrencyConverter with id
Creating an Instance Variable for CurrencyConverter with the Class Name
Creating an Instance Variable for CurrencyConverter with a Superclass Name
Managing Instance Variable Visibility
Summary
Q&A
Workshop
Hour 9. Declaring Properties in an Interface File
Comparing Interface Variables and Properties
Using Declared Properties
Using Attributes
Implementing Properties
Summary
Q&A
Workshop
Hour 10. Declaring Methods in an Interface File
Working with Methods in a Class
Reviewing Method Syntax
Summary
Q&A
Workshop
Hour 11. Declaring Actions in an Interface File
Introducing Actions
Comparing Actions in OS X and iOS
Summary
Q&A
Workshop
Hour 12. Routing Messages with Selectors
Getting Inside Objective-C Messages
Getting Inside the Objective-C Runtime
Working with SEL and @selector ()
Using performSelector
Using NSInvocation
Testing Whether an Instance Can Respond to a Selector
Summary
Q&A
Workshop
Hour 13. Building on the Foundation
Exploring the Foundation Framework
Foundation Classes
Foundation Paradigms and Policies
Summary
Q&A
Workshop
Hour 14. Defining a Class in an Implementation File
Working with a New Project
Creating a New App
Implementing a Method
Expanding the Class with init Methods
Summary
Q&A
Workshop
Hour 15. Organizing Data with Collections
Collecting Objects
Getting Familiar with Property Lists
Comparing the Collection Classes
Creating a Collection
Using Objective-C Literal Syntax
Enumerating a Collection
Testing Membership in a Collection
Accessing an Object in a Collection
Summary
Q&A
Workshop
Hour 16. Managing Memory and Runtime Objects
Managing Objects in Memory
Managing Reference Counts Manually
Managing Reference Counts with ARC
Variable Qualifiers
Autoreleasing Variables
Summary
Q&A
Workshop
Part III: Expanding and Extending Classes
Hour 17. Extending a Class with Protocols and Delegates
Exploring the Pros and Cons of Subclassing
Introducing the Example
Working with Protocols
Working with Delegates
Putting Protocols and Delegates Together
Looking Deeper Inside Protocols
Summary
Q&A
Workshop
Hour 18. Extending a Class with Categories and Extensions
Comparing Categories and Protocols
Comparing Categories with Subclasses
Working with Categories
Using Class Extensions
Working with Informal Protocols
Summary
Q&A
Workshop
Hour 19. Using Associative References and Fast Enumeration
Catching Up on Objective-C 2.0 Time-Saving Features
Extending Classes by Adding Instance Variables (Sort of)
Using Fast Enumeration
Summary
Q&A
Workshop
Hour 20. Working with Blocks
Revisiting Blocks
Looking at Callbacks
Introducing Blocks
Exploring Blocks in Cocoa
Looking Deeper into Cocoa Blocks and Memory
Summary
Q&A
Workshop
Part IV: Beyond the Basics
Hour 21. Handling Exceptions and Errors
Rethinking Exceptions and Errors
Introducing the Exception and Error Classes
Identifying an Exception
Throwing an Exception
Catching an Exception
Summary
Q&A
Workshop
Hour 22. Grand Central Dispatch: Using Queues and Threading
Getting Started with Concurrency
Introducing Queues
Using Dispatch Queues
Summary
Q&A
Workshop
Hour 23. Working with the Debugger
Logging Information
Using Console Logs
Using Smart Breakpoints
Summary
Q&A
Workshop
Hour 24. Using Xcode Debug Gauges for Analysis
Putting Debug Gauges in Perspective
Using Instruments
Summary
Q&A
Workshop
Part V: Appendixes
Appendix A. C Syntax Summary
Data Types
Control Structures
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Hour 5. Using Compiler Directives
Next
Next Chapter
Hour 6. Exploring Messaging and a Testbed App
Part II: Working with the Objective-C Basics
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset