开发者

memory and Interface Builder objects

i'm a little confused about memory managment with IB objects, here what i've done:

  • i've a navigation controller, i push other view with

    ...[[[viewController alloc]init]autorelease]...

  • I connect EACH element of Interface Builder to a IBOutlet so defined:

    开发者_C百科@property(nonatomic, retain) IBOutlet *object

    and in .m file : @synthesize object = _object

  • Then in viewDidUnload: self.object = nil;

  • Finally in dealloc method: [_object release];

Is this a right way to manage Interface Builder object's memory?


Yes, you did everything correct.

Just one thing - you don't have to make outlets for all your UI elements, you can create them only for those you need to access in code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜