读书时间2011/06/26 Objective-C

 

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

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值