Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Title Page
Copyright Page
Praise for the First Edition of Learning Objective-C 2.0
Dedication Page
Contents at a Glance
Contents
Preface
About This Book
Who Should Read This Book
What You Need to Know
About the Examples
About the Exercises
Objective-C—A Moving Target
ARC or Not
How This Book Is Organized
We Want to Hear from You!
Reader Services
Acknowledgments
About the Author
Part I: Introduction to Objective-C
1. C, the Foundation of Objective-C
The Structure of a C Program
Variables
Operators
Expressions and Statements
Program Flow
Preprocessor
Command Line Compiling and Debugging
Summary
Exercises
2. More about C Variables
Memory Layout of a C Program
Automatic Variables
External Variables
Declaration Keywords
Scope
Dynamic Allocation
Summary
Exercises
3. An Introduction to Object-Oriented Programming
Object-Oriented Programming
An Introduction to Objective-C
Objective-C Additions
Summary
4. Your First Objective-C Program
Building with Xcode
Objective-C Program Structure
An Object-Oriented “Hello World”
main.m
Summary
Exercises
Part II: Language Basics
5. Messaging
Methods
Messaging
Messaging Details
Under the Hood
Message Forwarding
Efficiency
Introspection and Other Runtime Fun
Summary
Exercises
6. Classes and Objects
Defining a Class
Subclassing a Class
Creating Objects
Destroying Objects
Copying Objects
Summary
Exercises
7. The Class Object
Class Objects
Other Class Methods
Mimicking Class Variables
Summary
Exercises
8. Frameworks
What Is a Framework?
Cocoa and Cocoa Touch
AppKit
UIKit
Core Foundation
Core Graphics
Core Animation
Other Apple-Supplied Frameworks
Third-Party Frameworks
Under the Hood
Summary
9. Common Foundation Classes
Immutable and Mutable Classes
Class Clusters
NSString
Collection Classes
NSNumber
NSNull
NSData
NSURL
Objective-C Literals and Object Subscripting
Structures
Geometry Structures on iOS
Summary
Exercises
10. Control Structures in Objective-C
if Statements
for Statements and Implicit Loops
while Statements and NSEnumerator
Fast Enumeration
An Example Using Fast Enumeration
Exceptions
Summary
Exercises
11. Categories, Extensions, and Security
Categories
Associative References
Extensions
Instance Variable Scope (Access Control)
Hiding Your Instance Variable Declarations
Access Control for Methods
Namespaces
Security
Calling C Functions from Objective-C
Summary
Exercises
12. Properties
Accessing Instance Variables Outside of an Object (Don’t Do It)
Declaring and Implementing Accessors
Accessors Using Properties
Synthesized Instance Variables
@synthesize by Default
Synthesis Summary
Private Properties
The @property Statement
More about @dynamic
Properties without Instance Variables
Properties and Memory Management
A Look Ahead at Automatic Reference Counting (ARC)
Subclassing and Properties
Hidden Setters for readonly Properties
Properties as Documentation
Dot Syntax
Summary
Exercises
13. Protocols
The Rationale for Protocols
Using Protocols
TablePrinter Example
Protocol Objects and Testing for Conformance
Informal Protocols
Summary
Exercises
Part III: Advanced Concepts
14. Memory Management Overview
The Problem
The Solutions: Objective-C Memory Management
Onward
15. Reference Counting
Reference Counting Basics
Receiving Objects
Ownership
dealloc
Returning Objects
retainCount
Multithreading
When Retain Counts Go Bad
Retain Cycles
The Final Goodbye: When Programs Terminate
Summary
Exercises
16. ARC
What ARC Is and Is Not
How ARC Works
ARC Imposes Some Rules
New Variable Qualifiers
Properties
Retain Cycles
ARC and Core Foundation
Casting to and from void*
ARC and Extra Autorelease Pools
ARC and Exceptions
Using ARC
ARC Uses Runtime Functions
More Information
Summary
Exercises
17. Blocks
Function Pointers
NSInvocation
Blocks
Some Philosophical Reservations
Summary
Exercises
18. A Few More Things
Enums with a Fixed Underlying Type
Forward Declarations of Methods in the @implementation Block Are No Longer Needed
Some New Documentation
Summary
Exercises
Part IV: Appendices
A. Reserved Words and Compiler Directives
B. Toll-Free Bridged Classes
C. 32- and 64-Bit
Kernel and User Programs in 64-Bit
Coding Differences for 64-Bit Programs
Performance
Compiling for 32-Bit and 64-Bit
More Information
D. The Fragile Base Class Problem
E. Resources for Objective-C
Apple Resources
Internet Resources
Groups
Books
Index
Footnotes
Preface
Chapter 1
Chapter 2
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 11
Chapter 12
Chapter 13
Chapter 17
← Prev
Back
Next →
← Prev
Back
Next →