-
2 votesanswersviews
当设置为只读时,property_getAttributes()在retain,strong,weak和assign属性之间没有区别
我正在尝试使用 property_getAttributes() 运行时函数获取对象的属性属性 . 某些属性设置为 read-only . 但是当我尝试在retain / strong,weak和assign属性之间做出区分时,就出现了问题 . 例如 . : 假设我们有: @interface MyObject : NSObject @property (assign, readonly) NS... -
2 votesanswersviews
Objective C中__strong用法的示例
我在这里阅读__strong引用和__weak引用用法:Explanation of strong and weak storage in iOS5 我尝试编写一些代码来演示这些知识 . 但是,__strong在释放时没有将对象保留在内存中 . 我做到了这一点: Parent * fumu = [[Parent alloc] init]; [fumu release]; 一切都按预期工作 .... -
2 votesanswersviews
释放弱引用iOS
我正在开发一个自定义iOS SDK . 我根据自己的要求创建了弱而强大的参考资料 . 我不清楚的是: when will the weakly reference object gets de-allocated? 假设我有3个对象 A,B,C . A 对 B 有弱引用, B 对 C 有强引用 . A --- >(weak ref) B --->(strong ref)C 所有3...