商品簡介
《Cocoa與Objective-C:構建與運行(英文)(影印版)》給你打下充分的理論基礎,然后向你展示如何使用Apple的快速開發工具——Xcode和Interface Builder,來開發Cocoa應用程序、管理用戶交互、創建很棒的UI等等。你將迅速獲得開發高級軟件所需的經驗,無論你是編程新手還是該平臺的入門用戶。
為Mac、iPhone和iPad打造健壯的應用程序,無論你是只有基本的編程技能,還是有多年的開發經驗。在《Cocoa與Objective-C:構建與運行(英文)(影印版)》中,你將通過循序漸進的教程、親身實踐的練習、簡明扼要的範例,以及來自Cocoa專家的諄諄教誨,學會如何運用Apple的Cocoa框架和Objective-C語
言。
作者簡介
作者:(美國)史蒂文森(Scott Stevenson)
Scott Stevenson,從事Cocoa應用開發八年,此外還擁有六年相關教學經驗。他曾創建了風靡一時的Mac編程博客Theocacao,并且于2003年接手Cocoa Dev Central,成為主筆和編輯。他在硅谷組織了多場Cocoa Heads會議,并發表演講。
目次
Preface
1. Setup and First Run
Download and Install Xcode
Your First Application
Create the Interface
Run the Finished Application
2. Thinking in Code: Basic C
How Code Works
How to Format Code
Variables
Types
Constants
Enumerated Types
Typedefs
Functions
Declaring Functions
Example: First Program
Displaying Values on the Command Line
Compile and Run the Example
Scope
Static Variables
Conditionals
Example: Shopping Trip
Compile and Run
Wrap Up
3. Memory and Pointers: Advanced C
Arrays
Loops
Text Strings
Multidimensional Arrays
Pointers
The Purpose of Pointers
Using Pointers
Pointers and the const Keyword
Dynamic Memory
Strings and Dynamic Memory
Returning Strings from Functions
Arrays of Strings
Example: Address Book
Compile and Run the Address Book Example
Structs
Header Files
Compile and Run the Header File Test Example
Create Files for the Song Struct
Final Example
4. Thinking in Objects
Structs and Classes
Designing Classes
Accessors
Inheritance
Composition
Object Lifetime
Built-in Classes
5. Basic Objective-C
NSString Basics
Using Methods
Nested Method Calls
Multi-Input Methods
Accessors
Dot Syntax
Creating Objects
Basic Memory Management
Using Autorelease Directly
Declaring a Class
Add Methods
Implementing a Class
init
dealloc
Example: PhotoInfo
6. More Objective-C
More on Memory Management
The Life of an Instance Variable
Copying Objects
Class Name Prefixes
Properties
Property Options
64-Bit Objective-C
Enabling 64-Bit
Should I Use 64-Bit?
All Further Examples Assume 64-Bit
Categories
Categories for Private Methods
Introspection
Protocols
Dynamic Messaging
Using Selectors to Call Methods
Forwarding Messages
Exceptions
Example: Data Collector
Some New Classes and Methods
Create the Files
Build and Run
7. Foundation Value Classes
NSString
Ranges and Substrings
Using NSString with C Types
Comparing Strings for Equality
Strings As File Paths
Reading and Writing Files with Strings
Mutability
Advantages of Mutability
Advantages of Immutability
Core Foundation
Memory Management
Core Foundation Mutability
Toll-Free Bridging
Core Foundation Types As Properties
Drawbacks of Core Foundation Types
Open Source
NSNumber
CFNumberRef
Cocoa Primitive Types
NSDecimalNumber
NSNumberFormatter
When to Use Which Number Type
NSData
NSMutableData
NSArray
Fast Enumeration
Blocks
NSMutableArray
CFArrayRef
NSIndexSet
NSDictionary
NSMutableDictionary
CFDictionaryRef
NSSet
NSMutableSet
NSValue
NSDate
CFDateRef
8. Basic Controls
How to Use This Chapter
Windows and Views
Targets and Actions
Buttons
Declaring Action Methods
Connecting Actions
Menus
Responder Chain
Pop-up Buttons
Sliders
Text Fields
Outlets
Datasources
Table View Datasource Methods
Implementing Datasource Methods
Bindings
Key-Value Protocols
Bindings for Simple Controls
Bindings for Complex Controls
Tips for Debugging Bindings
……
9 Designing Applications Using MVX
10 Custom Views and Drawing
11 The Final Word
Index