开发者

Passing variables from delegate iOS

im passing an array from my app delegate to a view controller as follows :

Delegate *appDelegate = [[UIApplication sharedApplication] delegate];
self.rows = appDelegate.getCourseArray;

My question is, when do i release 'appDelegate'? i tried to release it after the variable is passed but that makes a开发者_StackOverflow blank screen (Black). I imagine its because im releasing the actual delegate and not the copy, but in this instance, am i supposed to release it?


You don't release it at all as you don't have ownership of it as per Apples Memory Management Rules.


There is no new, allco, retain or copy (NARC) in the line that obtains the appDelegate to there is no ownership and no release/autorelease needs or should be issued.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜