Re: Objective-C++
Re: Objective-C++
- Subject: Re: Objective-C++
- From: Scott Andrew <email@hidden>
- Date: Mon, 11 Feb 2008 09:06:39 -0800
We did a photoshop plugin at my day job using Objective C++. We
started the project by creating a Cocoa Plug-in then just changed the
file names to .mm and made sure we always created the names with .mm.
One other good thing to do, at least it was for us, was to write
objective C wrappers around C++ code hiding C++ strings and such. Alot
of the Objectve C code were operations on the C++ object not a one for
one all ratio. Just made our life easier and the C++ wasn't scattered
through out the code.
Scott
On Feb 11, 2008, at 8:52 AM, Jens Miltner wrote:
Am 09.02.2008 um 01:04 schrieb Herb Petschauer:
Depends on what you are doing. If you are actually writing a Cocoa
App then why not create a new Cocoa App? You get a default nib, etc.
for free. Just create new files with .mm.
In case this is not immediately obvious - if you choose a template
from Xcode's "New File..." asisstant, you can rename the file to end
with .mm right there.
BTW: I found it easier to have _all_ my Objective-C files have .mm
extensions. Most of our code does reference a C++ class or the other
and even for pure Objective-C code having it compiled as Objective-C+
+ usually doesn't hurt (unless you compile against a library that
doesn't have C++-savvy header files).
By making all my files Objective-C++, I avoid these 10 minutes of
confusion until I discover that the only reason the compiler
complains about some apparently well-formed C++ header file is
because it's compiling in plain-C mode ;-)
</jum>
_______________________________________________
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
_______________________________________________
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