• 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: Distributed postNotificationName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Distributed postNotificationName


  • Subject: Re: Distributed postNotificationName
  • From: Rob Ross <email@hidden>
  • Date: Fri, 17 Nov 2006 01:17:44 -0800

Well one thing I can see is that in that method, you want to store the value first, then the key.

I'm assuming @"someID" is a key, not your value, so this list should really be:

NSDictionary*  userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:7], @"someID",  name, @"someName", nil];

The name of the method is a good memory aid :)

Rob Ross, Lead Software Engineer
E! Networks

---------------------------------------------------
"Beware of he who would deny you access to information, for in his heart he dreams himself your master." -- Commissioner Pravin Lal



On Nov 17, 2006, at 12:58 AM, Trygve Inda wrote:

NSDictionary*  userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
@"someID", [NSNumber numberWithInt:7], @"someName", name, nil];

[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"myNotification" object:nil userInfo:userInfo
deliverImmediately:YES];


This fails. If I remove the @"someID", [NSNumber numberWithInt:7] it works.


How can I send a number in the dict?

The docs say:

The notificationInfo dictionary is serialized as a property list, so it can
be passed to another task. In the receiving task, it is deserialized back
into a dictionary. This serialization imposes some restrictions on the
objects that can be placed in the notificationInfo dictionary. See XML
Property Lists for details.


NSNumber is on the approved list, so when doesn't it work?

If I only send NSStrings in the dict, all is well.

Thanks,

Trygve


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40eentertainment.com


This email sent to email@hidden

_______________________________________________ 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
  • Follow-Ups:
    • Re: Distributed postNotificationName
      • From: Trygve Inda <email@hidden>
References: 
 >Distributed postNotificationName (From: Trygve Inda <email@hidden>)

  • Prev by Date: Distributed postNotificationName
  • Next by Date: Re: Distributed postNotificationName
  • Previous by thread: Distributed postNotificationName
  • Next by thread: Re: Distributed postNotificationName
  • Index(es):
    • Date
    • Thread