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

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

  • Prev by Date: Re: How to completely release every object allocated when opening a NIB file ?
  • Next by Date: Re: NSText sizeToFit doesn't
  • Previous by thread: calling cocoa method inside carbon function...
  • Next by thread: Re: calling cocoa method inside carbon function...
  • Index(es):
    • Date
    • Thread