• 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
Re: Can NSNotificationCenter Memorize Old Events?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Can NSNotificationCenter Memorize Old Events? (From: Bing Li <email@hidden>)

  • Prev by Date: Can NSNotificationCenter Memorize Old Events?
  • Next by Date: Re: Asynchronous Notification Does NOT Work
  • Previous by thread: Can NSNotificationCenter Memorize Old Events?
  • Next by thread: Re: Can NSNotificationCenter Memorize Old Events?
  • Index(es):
    • Date
    • Thread