Apple's iPhone Online Videos
Introduction to Objective-[C and Cocoa Touch
0. 杂想杂问:
Milestone升级为Android 2.2,可支持Hot Spot功能!
http://bbs.spforum.net/viewthread.php?tid=324923
*** Objective-C ***
1. Memory Mangement
为什么要用retain/release?
原因是从系统得到的对象,有可能被放入了autorelease pool,若不retain,则可能被released!
example:
myString = [[NSString alloc] initWithString:@"foo"];
^ why ? 2011/12/21
myString = [NSString stringWithString:@"foo"];
区别:后者被autoreleased,所以,一定要retain/release. Q:WHY ? HOW ? 2011/12/21
2. Setter method
-(void)setName:(NSString*)newName {
if(newName!=name) {
[newName retain];
[name release];
name = newName;
}
}
3. Property
* Attribute
Mutability: readonly/readwrite
Memory Mangement behaviour: assign/retain/copy
^ 区别?2011/12/21
Concurrency: nonatomic
4. category
5. procotol
*** Cocoa Touch ***
1. core founcation classes
* NSString
* NSArray
* NSMutableDictionary
2. File I/O
*special directories
tmp: cleared, not backed up
library/Cache: saved, not backed up ???
everything else: backed up ???
^ What's this ? 2011/12/21
3. NSLog
4. Bundles
a special kind of folder
. executable
. UI file
. Metadata
. resources
5. Networking
CFMetwork,
CFSocket
POSIX
6. UIKit
Controls
Web View
7. Design Patterns
* MVC
Model: Foundation
View: UI Kit
Controller: UIKit
* Target-action
Control:
Target: object
Action: Selector
* Notifications
Observed object -> Notification Center -> Controller/Observer
* Delegation
Application Delegate: when app lunched ???
Customization without subclassing ???
* Summary of all patterns