UIViewController的子类立即发布
子类化 UIViewController 我在 NIB 文件中有 UIView,然后添加名为 CustomViewController 的自定义类的“Object”,该类具有view 属性连接到来自NIB 文件的UIView 和Interface Builder 中连接的其他IBOutlet UIImageView。
我的问题是为什么这个类从 NIB 加载(调用 initWithNibName)并立即释放。
Subclassing UIViewController I have UIView within NIB file then add "Object" with Custom Class named CustomViewController, this class have view property connected to the UIView from NIB file and other IBOutlet UIImageView connected within Interface Builder.
My question if why this class is loaded from NIB (initWithNibName is called) and is released immediately.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
笔尖中加载的所有内容都会自动释放。如果您没有显式保留它,或者没有将其连接到属性定义中声明的 IBOutlet 属性,则它将消失。 (通常会让你不高兴。)
Everything loaded in a nib is autoreleased. If you don't explicitly retain it, or connect it to an IBOutlet property with retain stated in the property definition, it will go away. (And usually make you unhappy.)