• 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: Notify With Parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notify With Parameters


  • Subject: Re: Notify With Parameters
  • From: Roland King <email@hidden>
  • Date: Thu, 02 Jun 2011 15:35:36 +0800

can't be compiled because he's done

	NSString *message = "Happy Holidays!";

instead of the proper syntax for a string constant

	NSString *message = @"Merry Christmas!";

or else the compiler hates 'Happy Holidays' as much as I do.

On 02-Jun-2011, at 3:32 PM, Jens Alfke wrote:

>
> On Jun 1, 2011, at 11:45 PM, Bing Li wrote:
>
>> My question is if it is possible to transmit data from WorkingApp to AppController?
>
> Sure; that’s what the userInfo dictionary in NSNotification is for.
>
>>       // The following code cannot be compiled.
>>       // NSString *message = "Happy holidays!";
>>       // [[NSNotificationCenter defaultCenter] postNotificationName:@"Done"
>> object:message];
>
> Why can’t it be compiled? I don’t see any errors in there.
>
> But this probably isn’t what you want. The ‘object’ parameter of a notification is generally supposed to be the object in your model that’s sending the notification (WorkingApp in your example) not a data value. The userInfo dictionary is where data values should go.
>
> —Jens_______________________________________________
>
> 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

_______________________________________________

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: 
 >Notify With Parameters (From: Bing Li <email@hidden>)
 >Re: Notify With Parameters (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Notify With Parameters
  • Next by Date: Re: Notify With Parameters
  • Previous by thread: Re: Notify With Parameters
  • Next by thread: Re: Notify With Parameters
  • Index(es):
    • Date
    • Thread