Re: Regarding MVC design pattern
Re: Regarding MVC design pattern
- Subject: Re: Regarding MVC design pattern
- From: Uli Kusterer <email@hidden>
- Date: Tue, 18 May 2010 18:32:37 +0200
On May 18, 2010, at 1:20 PM, Sai wrote:
> Anyway, why I should retain that?
Because otherwise it will get autoreleased, but your instance variable will still contain its address, and the next time you try to use it via the instance variable, you will try to talk with random memory at that address, which is a Bad Idea(tm). It may still look like the object that was last there, it may look like a completely different object, or it may have been overwritten by someone in the meantime.
> Will it be released by "somebody"?
Hopefully by your dealloc method.
This behaviour would only be different if you were using the garbage collector.
If all of this is new to you, you should really try to get a good book about the basics of Cocoa objects and memory management.
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden