您的位置:首页 > 其它

Ownership of Memory Management

2013-12-15 22:28 232 查看


1. You Have Ownership of Any Objects You Create

You use a method whose name begins with one of the following, which means that you are creating an object and have ownership of it.

alloc

new

copy

mutableCopy

However, the naming convention is not applied to the following methods.

allocate

newer

copying

mutableCopyed

2. [NSObject new] and [[NSObject alloc] init] do exactly the same thing.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: