• 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: calling cocoa method inside carbon function...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calling cocoa method inside carbon function...


  • Subject: Re: calling cocoa method inside carbon function...
  • From: James Chen <email@hidden>
  • Date: Tue, 13 Jan 2004 09:31:28 +0800

Hi,
I think you should wrap the cocoaObject up first since the carbon function resides in file with extension c or cpp (which is not .m).
And the wrapper should be implement in .m or .mm file (same as the cocoaObject will be fine):
void CallCocoaObjectMyMethod(CocoaObjectClass *inCocoaObject)
{
[inCocoaObject myMethod];
}
Then your carbon function:
void myCarbonMethod()
{
CallCocoaObjectMyMethod(cocoaObject);
}
Hope this works,
James
------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
On Jan 12, 2004, at 9:48 AM, Jacob Chapa 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.

Thanks a lot
_______________________________________________
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.
_______________________________________________
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.

References: 
 >calling cocoa method inside carbon function... (From: Jacob Chapa <email@hidden>)

  • Prev by Date: Controlling NSTextView's ruler accessory view
  • Next by Date: Re: Reusing the last viewed directory
  • Previous by thread: Re: calling cocoa method inside carbon function...
  • Next by thread: Bindings question
  • Index(es):
    • Date
    • Thread