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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com