We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于strong和weak的理解: NSObject * temp = [[NSObject alloc] init]; __strong NSObject * temp = [[NSObject alloc] init]; 这样有什么区别呢?
arc中没有strong和weak能不能正常运行?
The text was updated successfully, but these errors were encountered:
NSObject * temp = [[NSObject alloc] init]; __strong NSObject * temp = [[NSObject alloc] init]; 这样有什么区别呢?
这两行没有任何区别,转换成汇编之后代码是一摸一样的。
不能,默认变量就是strong的。arc本质上是retain/release/autorelease等函数,strong/weak是给编译器看的,编译器见到strong/weak会选择调用不同的arc函数
Sorry, something went wrong.
我是不是可以这么理解: 在arc中,retain和strong是等同的,他们代表对象引用计数会增加,通过SideTable来实现; weak则不一样,引用计数不会增加,通过弱引用表来实现
No branches or pull requests
关于strong和weak的理解:
NSObject * temp = [[NSObject alloc] init];
__strong NSObject * temp = [[NSObject alloc] init];
这样有什么区别呢?
arc中没有strong和weak能不能正常运行?
The text was updated successfully, but these errors were encountered: