Re: Exception raised during posting of notification
Re: Exception raised during posting of notification
- Subject: Re: Exception raised during posting of notification
- From: j o a r <email@hidden>
- Date: Mon, 30 May 2005 07:43:06 +0200
I would bet that you forgot to _unregister_ your subscribed objects:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
Notifications/Tasks/Registering.html#//apple_ref/doc/uid/
20000723-98846-BABCBAJA>
Subscriptions for notifications needs to always be balanced with an
unsubscribe at some later point, usually in the dealloc method.
j o a r
On 30 maj 2005, at 05.12, Andrew Shamel wrote:
I am receiving an exception when I try to post a notification in
the following code:
[[NSNotificationCenter defaultCenter] postNotificationName:
[aSkillName stringByAppendingString:@" Modifier"] object:nil
userInfo:[NSDictionary dictionaryWithObject:array forKey:@"Modifier
Array"]];
The notification does not even get to the intended objects (the
NSLog() at the beginning of the method does not get printed) but
instead I get an exception that looks like this:
2005-05-28 20:04:24.338 Philo[5877] *** -[NSCFArray
postSkillModifier:]: selector not recognized [self = 0x3c68b0]
2005-05-28 20:04:24.339 Philo[5877] Exception raised during posting
of notification. Ignored. exception: *** -[NSCFArray
postSkillModifier:]: selector not recognized [self = 0x3c68b0]
The objects that are registered to observe for this notification
are not Arrays, and have the following code to register themselves
with the NSNotificationCenter:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(postSkillModifier:) name:[[classSkillNamesArray
objectAtIndex:g] stringByAppendingString:@" Modifier"] object:nil];
I am totally at a loss as to why the notifications are not making
it to the intended objects (the ones that registered for them) but
are being sent to mysterious Arrays.
Thank you so much for any help!
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden