• 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
Cocoa dylib access by C program
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa dylib access by C program


  • Subject: Cocoa dylib access by C program
  • From: Kirk Kerekes via Cocoa-dev <email@hidden>
  • Date: Fri, 13 Nov 2020 14:50:50 -0600

Change your .c files to .m. Then you can use objective-c calls _in_ your C
code.

Objective C is a proper superset of C, and so you just need to inform the
compiler of your intent by changing the file extension(s).

Kirk Kerekes
(iPhone)

> Message: 1
> Date: Fri, 13 Nov 2020 11:16:23 -0800
> From: Carl Hoefs <email@hidden>
> To: cocoa-dev <email@hidden>
> Subject: Cocoa dylib access by C program
> Message-ID:
>    <email@hidden>
> Content-Type: text/plain;    charset=us-ascii
>
> I have built an ObjC/Cocoa/Foundation library.dylib; it works well when
> linked with ObjC apps.
>
> But now I need to link a C program against that library. How do I invoke the
> ObjC library methods from a C program? (I know I can add C function entry
> points to the library, but how do they invoke the internal ObjC library
> methods?)
>
> -Carl
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Cocoa dylib access by C program
  • Next by Date: Re: How can I get horizontal scrollbars adequate to the widest list entry
  • Previous by thread: Re: Cocoa dylib access by C program
  • Next by thread: Drag&Drop image opacity
  • Index(es):
    • Date
    • Thread