On Wed, May 19, 2010 at 6:31 AM, Joanna Carter
<cocoa...@carterconsulting.org.uk> 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 (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 arch...@mail-archive.com

Reply via email to