On Nov 17, 2008, at 11:58 PM, mmalcolm crawford wrote:


On Nov 17, 2008, at 8:34 PM, Brian Stern wrote:

Don't you find it odd that you need to release outlets in didReceiveMemoryWarning?

Not at all -- assuming that you have a reference -- strong or weak -- to an item in the user interface, you want to make sure you break it if the view is supposed to disappear. If you have a strong reference you want to make sure that the item is disposed of when the other items from the nib go away; if you have a weak reference you want to make sure you don't send a message to a deallocated object (it'll go when the view goes...).

UIViewController isn't guaranteed to release the view. It only does this if the view isn't visible, based on its own heuristics. My subclass has no real way to know if the view will be released or not.

If I release the outlets in viewDidLoad then I don't have this problem. My code has no interest in maintaining a strong reference to its outlets. The view hierarchy can do that just fine.


--
Brian Stern
[EMAIL PROTECTED]



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to