Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Title
Copyright
Dedication
Contents at a glance
Contents
Foreword
About the Authors
About the Technical Reviewer
Acknowledgments
Working with This Book
Chapter 1: Hello
Before You Start
Where the Future Was Made Yesterday
What’s Coming Up
Getting Ready
Summary
Chapter 2: Extensions to C
The Simplest Objective-C Program
Building Hello Objective-C
Deconstructing Hello Objective-C
That Wacky #import Thing
Introducing Frameworks
NSLog() and @"strings
Are You the Boolean Type?
Mighty BOOL in Action
Summary
Chapter 3: Introduction to Object-Oriented Programming
It’s All Indirection
Variables and Indirection
Indirection Through Filenames
Using Indirection in Object-Oriented Programming
Procedural Programming
Implementing Object Orientation
Time Out for Terminology
OOP in Objective-C
The @interface Section
The @implementation Section
Instantiating Objects
Extending Shapes-Object
Summary
Chapter 4: Inheritance
Why Use Inheritance?
Inheritance Syntax
Time Out for Terminology
How Inheritance Works
Method Dispatching
Instance Variables
Overriding Methods
I Feel Super!
Summary
Chapter 5: Composition
What Is Composition?
Car Talk
Customizing for NSLog()
Accessor Methods
Setting the Engine
Setting the Tires
Tracking Changes to Car
Extending CarParts
Composition or Inheritance?
Summary
Chapter 6: Source File Organization
Split Interface and Implementation
Making New Files in Xcode
Breaking Apart the Car
Using Cross-File Dependencies
Recompiling on a Need-to-Know Basis
Making the Car Go.
Importation and Inheritance
Summary
Chapter 7: More About Xcode
One Window to Rule Them All
Changing the Company Name
Using Editor Tips and Tricks
Writing Your Code with a Little Help from Xcode
Indentation (Pretty Printing)
You Complete Me
Kissing Parentheses
Mass Edits
Navigating Around in Your Code.
Focus Your Energy
The Navigation Bar Is Open
Getting Information
Debugging
Crush Puny Bugs
Xcode’s Debugger
Subtle Symbolism
Let’s Debug!
Taking a Look-See
Cheat Sheet
Summary
Chapter 8: A Quick Tour of the Foundation Kit
Solid Foundation
Using the Project Boilerplate Code
Some Useful Types
Home on the Range
Geometric Types
Stringing Us Along
Build That String
Class Methods
Size Matters
Comparative Politics
Insensitivity Training
Is It Inside?
Mutability
Collection Agency
NSArray
Mutable Arrays
Enumeration Nation
Fast Enumeration
NSDictionary
Use but Don’t Extend
Family Values
NSNumber
NSValue
NSNull
Example: Looking for Files
Behind the Sign That Says Beware of the Leopard
Summary
Chapter 9: Memory Management
Object Life Cycle
Reference Counting.
Object Ownership
Retaining and Releasing in Accessors
Autorelease
Everyone into the Pool!
The Eve of Our Destruction
Pools in Action
The Rules of Cocoa Memory Management
Transient Objects
Hanging on to Objects
Take Out Those Papers and the Trash
Automatic Reference Counting
Being Exceptional
Keywords for Exceptions
Catching Different Types of Exceptions
Throwing Exceptions
Exceptions Need Memory Management Too
Exceptions and Autorelease Pools
Summary
Chapter 10: Object Initialization
Allocating Objects
Initializing Objects
Writing Initialization Methods
What to Do When You’re Initializing
Isn’t That Convenient?
More Parts Is Parts182
Init for Tires
Updating main()
Cleaning Up the Car
Car Cleaning, GC and ARC Style
Making a Convenience Initializer
The Designated Initializer
The Subclassing Problem
Fixing Tire’s Initializers
Adding the AllWeatherRadial Initializer
Initializer Rules
Summary
Chapter 11: Properties
Shrinking Property Values
Shrinking the Interface
Shrinking the Implementation
Dots Incredible
Objecting to Properties
Appellation Spring
Read-Only About It
I’d Rather Do It Myself
Alas, Properties Don’t Do Everything
Summary
Chapter 12: Categories
Creating a Category
Let’s Create a Category
@interface
@implementation
Bad Categories
Good Categories
Clint Eastwood Would Love This
Splitting an Implementation with Categories
Using Categories in our Project
Making Forward References with Categories
Categories to the Rescue!
Informal Protocols and Delegation Categories
The ITunesFinder Project
Delegates and Categories
Responds to Selectors
Other Uses for Selectors
Summary
Chapter 13: Protocols
Formal Protocols
Declaring Protocols
Adopting a Protocol
Implementing a Protocol
Car-bon Copies
Copying Engines
Copying Tires
Copying the Car
Protocols and Data Types
Objective-C 2.0 Goodies
The Delegation Will Come to Order
Summary
Chapter 14: Blocks and Concurrency
You’re Never Too Old to Play with Blocks
Blocks and Function Pointers
Objective-C Objects
Concurrency, or Keeping Up with Yourself
Synchronize
Memory Management Is for Queues Too
Operation Queues
Summary
Chapter 15: Introduction to UIKit
View Controllers
Adding Items to the Nib File
Summary
Chapter 16: Introduction to the Application Kit
Making the Project
Making the Delegate @interface
Interface Builder
Laying Out the User Interface
Making Connection
Hooking Up the Outlets
Hooking Up the Actions
AppDelegate Implementation
Summary
Chapter 17: File Loading and Saving
Property Lists
NSDate
NSData
Writing and Reading Property Lists295
Modifying Objects
Encoding Objects
Summary
Chapter 18: Key-Value Coding
A Starter Project
Introducing KVC
A Path! A Path!
Aggregated Assault
Pit Stop
Smooth Operator
Life’s a Batch
The Nils Are Alive
Handling the Unhandled
Summary
Chapter 19: Using the Static Analyzer
Getting Some Static
Going Into Analysis
Assisting the Analyzer
On Further Analysis
Summary
Chapter 20: NSPredicate
Creating a Predicate
Evaluate the Predicate
Fuel Filters
Format Specifiers
Hello Operator, Give Me Number
Comparison and Logical Operators
Array Operators
SELF Sufficient
String Operation
Like, Fer Sure
That’s All, Folks
Appendix A
Index
← Prev
Back
Next →
← Prev
Back
Next →