• 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: address of method in a class instance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address of method in a class instance


  • Subject: Re: address of method in a class instance
  • From: Fritz Anderson <email@hidden>
  • Date: Wed, 5 Sep 2001 13:36:13 -0500

The info field in the context struct you use to specify the callback is yours to use as you will. Can you not just set info to your object pointer and make the callbacks simple wrappers for your methods (warning: typed blind):

@interface (MyClass)
- (const void *) releaseCallback;
@end

const void *
MyClassReleaseCallback(void * info)
{
MyClass * obj = (MyClass *) info;
return [obj releaseCallback];
}

-- F

On Wednesday, September 5, 2001, at 12:52 PM, Robert S Goldsmith wrote:

The CF callbacks are based on C and as such ask you to pass a pointer to a function that gets run when the event occurs. This is fine if you only have one instance of a class (you can hack it with bits of C) but I am not happy with that.

What I need is a way to get hold of the address of an ObjC class instance member method. This way I can pass the address and when the callback happens, the correct instance is notified ...


--
Fritz Anderson <email@hidden>
Parallel Software <http://www.parallel.com/>
Naperville, Illinois +1 877-PARALLEL (727-2553)


References: 
 >address of method in a class instance (From: Robert S Goldsmith <email@hidden>)

  • Prev by Date: Dirent?
  • Next by Date: Re: Clearing Browser Selection
  • Previous by thread: Re: address of method in a class instance
  • Next by thread: Re: address of method in a class instance
  • Index(es):
    • Date
    • Thread