开发者

Passing variables from delegate iOS

开发者 https://www.devze.com 2023-04-08 19:08 出处:网络
im passing an array from my app delegate to a view controller as follows : Delegate *appDelegate = [[UIApplication sharedApplication] delegate];

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

精彩评论

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