Re: calling cocoa method inside carbon function...
Re: calling cocoa method inside carbon function...
- Subject: Re: calling cocoa method inside carbon function...
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 12 Jan 2004 05:49:18 -0500
on 2004-01-11 8:48 PM, Jacob Chapa at email@hidden wrote:
>
I have a self defined carbon function and I want to call a cocoa method
>
from it.
>
>
I know I can make carbon calls from cocoa methods, i.e:
>
>
- (void) myCocoaMethod
>
{
>
CarbonCallhere():
>
}
>
>
but I cant do something like this:
>
>
void myCarbonMethod()
>
{
>
[cocoaObject myMethod];
>
}
>
>
is there a workaround to this?
>
>
The carbon method being called is a callback function and I am trying
>
to use a cocoa speech object inside of it.
Normally, your callback function has to pass self or your cocoaObject into
the callback function in the userInfo parameter (or refCon, or whatever it's
called). Otherwise, your callback function doesn't have access to the Cocoa
object.
There is a way to avoid the need to pass the object into the callback
method, but I've forgotten the details. Something about implementing the
callback inside of a Cocoa method.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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.