• 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: C callback function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C callback function


  • Subject: Re: C callback function
  • From: Bill Bumgarner <email@hidden>
  • Date: Fri, 2 Mar 2007 22:43:57 -0800

On Mar 2, 2007, at 10:20 PM, Guy Meyer wrote:
I have got a C callback function within an object.

The said callback function needs access one of the objects variables.

If the said object was a singleton the solution was to create a global variable outside the scope of the object accessible to both the object and the c callback function.

However, as the object is instantiated multiple times the said global variable can not be shared amongst all callback functions and should be unique for each object.

Any suggestion will be appreciated.

Most callback functions have some kind of context argument, typically a (void *). You would generally pass the object as the context argument, thus allowing you to message the object in your callback function.


b.bum

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >C callback function (From: Guy Meyer <email@hidden>)

  • Prev by Date: Re: C callback function
  • Next by Date: Re: C callback function
  • Previous by thread: Re: C callback function
  • Next by thread: Re: C callback function
  • Index(es):
    • Date
    • Thread