Re: Is this a bug, or am I hacking?
Re: Is this a bug, or am I hacking?
- Subject: Re: Is this a bug, or am I hacking?
- From: Keary Suska <email@hidden>
- Date: Fri, 15 Aug 2008 07:53:24 -0600
- Thread-topic: Is this a bug, or am I hacking?
8/14/08 6:45 PM, also sprach email@hidden:
> [[NSNotificationCenter defaultCenter] addObserver:self selector:
> (<...>) name:kMyConstant1 object:<theObjectOfInterest>];
>
> My observer doesn't receive notifications from kMyConstant2 even
> though it's defined to be the same literal string as kMyConstant1.
>
> As it turns out I can get the functionality I need by simply
> subscribing to both notifications, but I was trying to avoid linking
> in the headers for all the object types that are contained by my data
> management code - the UI for that model doesn't otherwise "need to
> know" what object types they are, as apart from this one notification,
> they conform to a common protocol.
What if we bark up the tree of the "object" parameter? If you are passing
this parameter, you will only receive notifications from the specific
object. It sounds like you are working with two different objects that you
want to receive notifications for. In this case, you will have to pass nil
for the object, and possibly test the object for interest in your
notification method.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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