Re: Can NSNotificationCenter Memorize Old Events?
Re: Can NSNotificationCenter Memorize Old Events?
- Subject: Re: Can NSNotificationCenter Memorize Old Events?
- From: "email@hidden" <email@hidden>
- Date: Mon, 06 Jun 2011 11:17:55 +0100
On 6 Jun 2011, at 10:51, Bing Li wrote:
> // The lines are used to save message in a dictionary to transmit
> with the notification
> NSMutableDictionary *messageDictionary = [[[NSMutableDictionary
> alloc] initWithCapacity:5] autorelease];
> [messageDictionary setObject:message forKey:"RECEIVED_MESSAGE"];
Try:
[messageDictionary setObject:message forKey:@"RECEIVED_MESSAGE"];
>
> // To my surprise, the line is invoked the same times as the times
> the client initializes a connection even though the client just sends only
> one message after each connection is initialized
> [[NSNotificationCenter defaultCenter]
> postNotificationName:"MESSAGE_RECEIVED" object:self
> userInfo:messageDictionary];
> }
Try:
[[NSNotificationCenter defaultCenter]
postNotificationName:@"MESSAGE_RECEIVED" object:self
userInfo:messageDictionary];
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com
_______________________________________________
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