开发者

Releasing appDelegate instances? [duplicate]

This question already has answers here: 开发者_运维知识库 Closed 11 years ago.

Possible Duplicate:

When should I release [[UIApplication sharedApplication] delegate] object?

I'm creating instances of UIApplication many times in my app to access shared infos, like this:

MyAppDelegate *appDelegate =  (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
appDelegate.ListingNav.navigationBarHidden = FALSE;

Well, how should it release all these appDelegate objects? Won't they create accumulated memory leaks ?

Thx for helping,

Stephane


In general, if you do not call alloc or retain, then you do not need to call release. You do not need to release appDelegate in this use case.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜