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

Re: Function Pointers


  • Subject: Re: Function Pointers
  • From: Scott Ribe <email@hidden>
  • Date: Sun, 27 Mar 2005 08:50:55 -0700

> I'm trying to interface with some c code that requires me to pass a
> function pointer.  I was wondering if its possible to pass a specific
> objects instance of a function.

No. If the API allows you to pass in some data for your function via a void
*, then you can use that to pass your object, along with a pointer to a
static function which will cast the void * to your function pointer and call
the appropriate method. If the API does not do this, it is poorly designed.


--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 665-7007 voice


 _______________________________________________
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

References: 
 >Function Pointers (From: Francisco Tolmasky <email@hidden>)

  • Prev by Date: Re: CFRunLoopRun
  • Next by Date: Re: absolutePathForAppBundleWithIdentifier:(returns nil)
  • Previous by thread: Function Pointers
  • Next by thread: reset font settings
  • Index(es):
    • Date
    • Thread