Re: Regarding MVC design pattern
Re: Regarding MVC design pattern
- Subject: Re: Regarding MVC design pattern
- From: Sherm Pendley <email@hidden>
- Date: Wed, 19 May 2010 07:38:15 -0400
On Wed, May 19, 2010 at 6:31 AM, Joanna Carter
<email@hidden> wrote:
> Any outlets for controls (top level objects) in the Nib should be released in the dealloc method only for OS X apps but not for iPhone apps. Setting the properties to nil will ensure that the synthesized setter will be called, which releases the previous contents of the synthesized ivar before setting it to nil.
>
> - (void) dealloc
> {
> beginButton = nil;
>
> endButton = nil;
>
> nameLabel = nil;
>
> numberLabel = nil;
>
> myModel = nil;
>
> [super dealloc];
> }
If you set the ivars directly, as above, the synthesized setters will
NOT be called. For that to happen, you need to use dot-syntax, like
this:
- (void) dealloc {
self.beginButton = nil;
self.endButton = nil;
// etc...
[super dealloc];
}
sherm--
--
Cocoa programming in Perl:
http://www.camelbones.org
_______________________________________________
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