Re: Passing C Style Function Callbacks in Cocoa
Re: Passing C Style Function Callbacks in Cocoa
- Subject: Re: Passing C Style Function Callbacks in Cocoa
- From: Hiro Fujimoto <email@hidden>
- Date: Sat, 10 Apr 2004 06:07:04 +0900
Vince,
How about using notification instead of sending message directly ?
--
On 2004/04/09, at 23:08, Vince Ackerman wrote:
Can anyone help?
On Apr 8, 2004, at 07:14, Vince Ackerman wrote:
Clark, Hiro, and others.
Thanks for responding. This C Style function callback is outside of
any objects and passed to 3rd party code I'm using with their USB
device. The "tmdin" value is an instance variable in one of my
objects (the address of one of the USB devices making the callback)
and not an object in itself. My problem was to be able to send a
message to my object from the callback that the device's variable
(aValue) had changed. I originally wanted to be able to pass off a
method in my object as the callback, but the third party code only
takes a C style function set up with the two variables (TMioDin*,
bool). Assigning my object to a "static id myObject" was a work
around that seemed to work for a while, but maybe it is being flushed
somehow. How do I create a variable like this outside of any other
object and retain it?
Perhaps the solution is to send a NSNotification from the callback?
Would that work outside all objects?
Thanks
------------------------------------------------------------------------
---------
hiro FUJIMOTO - developer in Japan.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.