Re: ReadProc can't use Objective C
Re: ReadProc can't use Objective C
- Subject: Re: ReadProc can't use Objective C
- From: Michael Thornburgh <email@hidden>
- Date: Mon, 23 Dec 2002 09:41:40 -0800
if your MIDIReadProc is implemented in a .m file, then you can use any
objective-c construct. you could use one of the RefCons to pass in
an objective-c object pointer, like
void myReadProc(const MIDIPacketList *pktlist, void *readProcRefCon,
void *srcConnRefCon)
{
SomeClass *anObject = readProcRefCon;
[anObject someMessage:pktlist];
}
there's no such thing as "self" or "super" inside your C function,
since those
only make sense in a method definition. but you can certainly send
messages
to an object, as long as you get your hands on the object in the first
place.
-mike
On Monday, December 23, 2002, at 08:33 AM, Craig Bakalian wrote:
Hi,
I have a standard ReadProc set up in a Cocoa app. I need to send the
data to a Cocoa Object. The standard C like nature of the readProc
can't see an Objective C function like -
[self sendMidiData: (unsigned)tonalValue]. What is a programmer to do?
Craig Bakalian
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.