Re: Objective C and C++
Re: Objective C and C++
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