6-ios_OCAdvance-1

1.reference count

when a obj was created,it's RC is 1,the system will callback when RC = 0

know what is AMR  &   MRC   model

release: RC - 1

retain:    RC + 1

2.@property in ARM Manager

@property(retain) only the obj type

@property(assign) don't create the ARM Manager code (Basic Data Type)

@property(copy) --> NSString

3.Thread

nonatomic --> not safe

atomic --> safe

4.@property authority

readwrite:both setter & getter

readonly:just getter method

5.@property rename the 2 methods

(getter = "")

6.@class & import

A Class --> B Class   in  A  import B

B Class --> A Class   in  B @class A

7.circular reference

when >2 objs start a circular reference:

when circular reference happens,the obj @porperty(,assign),we don't use the assign,replace with the assign

8.@autoreleasepool

[obj autorealse]

put the objs in

@autorelease{

}

it will auto realse in the end

Order:

  outer --> inner

9.NSAutoreleasepool

allocate a NSAutoreleasepool and [pool release]

we can write the autorealse sentence in getter method

10.autorelease scene:

     1.class method --> @autorealsepool

     2.in getter method

11.ARC & MRC

we should't write the [super dealloc] in ARC model

__strong : strong indicator identification

__weak   :weak indicator identification --> application scene : when circular reference happens,there must exist a weak indicator

12.intancetype

intancetype in OC ~ instance of in Java

Sum:

normally we use the ARC Model,so we will see the specific details in Real Project

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值