• 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: Andreas Monitzer <email@hidden>
  • Date: Wed, 5 Sep 2001 20:13:25 +0200

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

As we have been discussing, CoreFoundation is a bit different from Foundation. As I have the pleasure of using it I am now in the situation where, to get callbacks to work correctly when wrapped in an ObjC class, I need a pointer to a function.

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 ...

any ideas?

I know it's nasty but unless Foundation has got a replacement for the CF callbacks i can use (and i have asked some of the people concerned directly if I can replace CF with Foundation), I need to do this :(

As I've already told you: The cleanest way is to write a converter-function, like:

void callback() {
[instance callback];
}

andy
--
Discussion forthcoming.


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

  • Prev by Date: Re: Any advantages of Unix formatting
  • Next by Date: Re: what's difference and relationship between CoreFoundation and Fou ndation framework
  • Previous by thread: address of method in a class instance
  • Next by thread: Re: address of method in a class instance
  • Index(es):
    • Date
    • Thread