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

Re: Calling ObjC instance method from C


  • Subject: Re: Calling ObjC instance method from C
  • From: MarketLogix Developer <email@hidden>
  • Date: Fri, 2 May 2003 15:56:57 -0700

No, no.

From the gcc man page:

---

You can specify the input language explicitly with the -x
option:

-x language
Specify explicitly the language for the following
input files (rather than letting the compiler choose a
default based on the file name suffix). This option
applies to all following input files until the next -x
option. Possible values for language are:

c c-header cpp-output
c++ c++-cpp-output
objective-c objc-cpp-output
objective-c++ (APPLE ONLY)
assembler assembler-with-cpp
ada
f77 f77-cpp-input ratfor
java

---

In this case you supply:

-x objective-c

on the compile line for MySource.c

and ObjC syntax compiles just fine in a .c



On Friday, May 2, 2003, at 03:14 PM, Jeff Disher wrote:

You can call Obj-C instance methods from a C function if you pass in (or instantiate) the correct instance. I don't think that you will be able to do this from a .c file, though, since the Obj-C compiler will only be used for .m (or .mm or .M) files.

-----------------------------------------------
bisk ~ OSX.2.5
G4 PowerMac Gigabit, Dual 500
Sony SDM-M81 18.1" LCD display
1GB, 40GB, SuperDrive(DVR 105)
HP "All-in-One" d135 BubbleJet
-----------------------------------------------
_______________________________________________
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.

  • Follow-Ups:
    • Re: Calling ObjC instance method from C
      • From: publiclook <email@hidden>
References: 
 >Re: Calling ObjC instance method from C (From: Jeff Disher <email@hidden>)

  • Prev by Date: Re: Calling ObjC instance method from C
  • Next by Date: Re: Calling ObjC instance method from C
  • Previous by thread: Re: Calling ObjC instance method from C
  • Next by thread: Re: Calling ObjC instance method from C
  • Index(es):
    • Date
    • Thread