• 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
Where is it better to register with NSNotificationCenter in class?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Where is it better to register with NSNotificationCenter in class?


  • Subject: Where is it better to register with NSNotificationCenter in class?
  • From: Samvel <email@hidden>
  • Date: Mon, 24 Mar 2008 23:51:22 -0500

Hi,

I run into troubles trying to register my object with NSNotificationCenter in class
-(id) init;


Basically here is my constructor:
	-(id) init
	{
	  self = [super init];

if( self) {
[[NSNotificationCenter defaultCenter]
addObserver: self
selector : @selector( downloadStarted:)
name : @"DownloadStarted"
object : nil];
//... (at this point self has lost it's original value having some '<value')
}

return self;
}


So, what method is the best place to put registration with NSNotificationCenter to? Ultimately I wish it would be done on automatic basis in similar way as with:
-(id) init;


Thanks.
_______________________________________________

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


  • Follow-Ups:
    • Re: Where is it better to register with NSNotificationCenter in class?
      • From: "Sherm Pendley" <email@hidden>
    • Re: Where is it better to register with NSNotificationCenter in class?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: outlineViewSelectionDidChange not called
  • Next by Date: Re: Memory Management and objects creation via static methods...
  • Previous by thread: Re: Memory Management and objects creation via static methods...
  • Next by thread: Re: Where is it better to register with NSNotificationCenter in class?
  • Index(es):
    • Date
    • Thread