• 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: Receiver type for instance message is a forward declaration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Receiver type for instance message is a forward declaration


  • Subject: Re: Receiver type for instance message is a forward declaration
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 10 May 2016 16:13:52 -0700
  • Feedback-id: 167118m:167118agrif8a:167118sbz7l15ghZ:SMTPCORP

On May 10, 2016, at 16:05 , Carl Hoefs <email@hidden> wrote:
>
> I'm not sure how context is to be used here

It has to be a value that’s unique to the piece of code that tests it. In effect, this means unique to the class that creates and responds to the observations. If you’re in Obj-C, the usual trick is to use the static address of something, like this:

> static void* kvoContext = &kvoContext;

This exploits a quirk of C to initialize the static variable as containing its own address. That means you can specify the ‘context:’ parameter as EITHER ‘kvoContext’ OR ‘&kvoContext’, so that forgetting the & is harmless.


_______________________________________________

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


  • Follow-Ups:
    • Re: Receiver type for instance message is a forward declaration
      • From: Carl Hoefs <email@hidden>
References: 
 >Receiver type for instance message is a forward declaration (From: Carl Hoefs <email@hidden>)
 >Re: Receiver type for instance message is a forward declaration (From: Quincey Morris <email@hidden>)
 >Re: Receiver type for instance message is a forward declaration (From: Carl Hoefs <email@hidden>)
 >Re: Receiver type for instance message is a forward declaration (From: Carl Hoefs <email@hidden>)
 >Re: Receiver type for instance message is a forward declaration (From: Quincey Morris <email@hidden>)
 >Re: Receiver type for instance message is a forward declaration (From: Carl Hoefs <email@hidden>)
 >Re: Receiver type for instance message is a forward declaration (From: Quincey Morris <email@hidden>)
 >Re: Receiver type for instance message is a forward declaration (From: Carl Hoefs <email@hidden>)

  • Prev by Date: Re: Receiver type for instance message is a forward declaration
  • Next by Date: Re: Receiver type for instance message is a forward declaration
  • Previous by thread: Re: Receiver type for instance message is a forward declaration
  • Next by thread: Re: Receiver type for instance message is a forward declaration
  • Index(es):
    • Date
    • Thread