• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Delegates -- WHAT is delegated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delegates -- WHAT is delegated?


  • Subject: Re: Delegates -- WHAT is delegated?
  • From: Nir Soffer <email@hidden>
  • Date: Thu, 21 Dec 2006 01:05:15 +0200


On Dec 21, 2006, at 00:16, Dustin Voss wrote:

* A delegating class should clean up its delegate references by calling [self setDelegate:nil] before destroying itself.

What do you gain by removing the reference to your delegate when you are deallocting yourself? Obviously you or one of the super classes will not call the delegate in their -dealloc method?


- (void)dealloc
{
	delegate = nil;
	[super dealloc];
}

I think it is the delegate responsibility to remove itself from the object it serve when it destroy itself.


Best Regards,

Nir Soffer

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Re: Delegates -- WHAT is delegated? (From: Sam Colombo <email@hidden>)
 >Re: Delegates -- WHAT is delegated? (From: Dustin Voss <email@hidden>)

  • Prev by Date: Re: Delegates -- WHAT is delegated?
  • Next by Date: Re: Delegates -- WHAT is delegated?
  • Previous by thread: Re: Delegates -- WHAT is delegated?
  • Next by thread: Re: Delegates -- WHAT is delegated?
  • Index(es):
    • Date
    • Thread