• 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: Objective C and C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C and C++


  • Subject: Re: Objective C and C++
  • From: Marc Vaillant <email@hidden>
  • Date: Sun, 21 Dec 2008 13:11:53 -0500
  • Mail-followup-to: Brian Hughes <email@hidden>, email@hidden

On Sun, Dec 21, 2008 at 10:20:29AM -0500, Brian Hughes wrote:
> I have an Cocoa application that in Objective C using xcode that uses Cocoa's
> gui.  Now I want to give it audio and midi functionality.  I have studied the
> sample code such as PlaySoftMidi, PlayFile , PlaySequence and I think I
> understand how to do what I want, except, how do I get my Cocoa app to work
> with C++.  I have read that I need to "wrap" the C++ code in Objective C.

You shouldn't need to wrap all your c++ in objective C.  You can mix
objc and c++ pretty readily (objc++).  You need to be careful of a few
things (e.g. virtual functions).  Read the following:

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_14_section_1.html#//apple_ref/doc/uid/TP30001163-CH10-SW1

Also, code that is pure c++ can be compiled as c++, it doesn't have to
be .mm files compiled as objc++.  However, objc code that uses those c++
classes will have to be objc++.

> Can I just change all my files from .m to .mm?  Any help would
> be appreciated.

Pretty much.  Again read the apple documentation in the link above.

Good luck,
Marc
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Objective C and C++
      • From: NickMtl <email@hidden>
References: 
 >Objective C and C++ (From: Brian Hughes <email@hidden>)

  • Prev by Date: Objective C and C++
  • Next by Date: Re: Objective C and C++
  • Previous by thread: Objective C and C++
  • Next by thread: Re: Objective C and C++
  • Index(es):
    • Date
    • Thread