• 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 methods from C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling Cocoa methods from C


  • Subject: Re: Calling Cocoa methods from C
  • From: Uli Zappe <email@hidden>
  • Date: Fri, 4 May 2001 14:53:20 +0200

Am Freitag, 4. Mai 2001 um 13:34 schrieb Rosyna:

How do i go about calling a Cocoa/Objc function I made in a C function. If I do
[self methodName] I get an error message "self is not defined"

The identity of an object is only known to the object's own methods (technically speaking, it's a hidden C parameter that's passed to these methods). This means that in a C function you have to call the object explicitly. To be able to do so, you probably have to pass the id of the object in question as a second parameter to your function, thus doing explicitly what Objective-C does implicitly for you:

void frontAndCenter(id object, ProcessSerialNumber psn);

Bye
Uli
________________________________________________________

Uli Zappe email@hidden
Lorscher Stra_e 5 http://www.ritual.org
D-60489 Frankfurt Fon: +49-700-ULIZAPPE
Germany Fax: +49-700-ZAPPEFAX
________________________________________________________


References: 
 >Calling Cocoa methods from C (From: Rosyna <email@hidden>)

  • Prev by Date: Re: Calling Cocoa methods from C
  • Next by Date: Re: Opening old Mac files without filename extensions
  • Previous by thread: Re: Calling Cocoa methods from C
  • Next by thread: Hide/Show Views
  • Index(es):
    • Date
    • Thread