• 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: Sending message to Objective-C object from C file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending message to Objective-C object from C file


  • Subject: Re: Sending message to Objective-C object from C file
  • From: "Kyle Sluder" <email@hidden>
  • Date: Sat, 28 Jul 2007 14:07:43 -0400

You could either recompile the C library as Objective-C (which, being
a strict superset of C, will require no alterations in your source
code), or you can call the Objective-C runtime directly.

Compiling as Objective-C is the easier method.  Bring up the info
window on your source files and change their type to Objective-C
source, then use #ifdef guards around your new code (I can't remember
what macro Objective-C defines, something like __OBJ_C__, forgive me).

If for some reason you can't do this, you can make calls into the
Objective-C runtime, as Objective-C is really just syntactic sugar for
a bunch of C functions/structs.  The Objective-C documentation has
information about the runtime API.

--Kyle Sluder

On 7/28/07, seyed mehdi nazemi <email@hidden> wrote:
>
>
> Hi everyone,
>
> I am an experienced programmer but quite new in Mac OS programming. I am
> developing a Cocoa application. I have an old C library files which I want
> to reuse in this application. Part of that C library file plays an audio
> file using another Audio library file. I want to replace functionality of
> that Audio library file with QuickTime.
>
> So I have created a Controller Objective-C object that includes
> QTMovieViewer and can use that to play an audio file. Now my question is how
> to send message to that Objective-C object from a C file in my old library.
>
> Thanks in advance
>
> Luca.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Sending message to Objective-C object from C file (From: "seyed mehdi nazemi" <email@hidden>)

  • Prev by Date: Re: Sending message to Objective-C object from C file
  • Next by Date: Custom embedded framework not working
  • Previous by thread: Re: Sending message to Objective-C object from C file
  • Next by thread: Custom embedded framework not working
  • Index(es):
    • Date
    • Thread