I have a bunch of utility classes and functions that I've collected in my 'toolbox' over the years. When I first started doing iPhone development, I was a little bummed out because the primary development language for it is Objective C, and while you can mix and match to a certain degree, I couldn't see how you could use C++ classes in tandem with Objective C classes. However, after poking around for a while, I've realized that I actually can include .cpp files and/or .mm files (treated the same way by the compiler.) I'm still playing around with how much/little I can actually pull over, but at least I don't have to give up everything. Cool!
Also, I did a little poking around the preprocessor and for those of you curious, the compiler preprocessor directives that you can use to detect development for Mac/iPhone are:
__APPLE_CC__ and __GNUCC__.
In otherwords
#if (defined(__APPLE_CC__) && defined(__GNUCC__))
should evaluate to true if you are developing for an OSX/iPhone environment. I need to dig a little more to detect the difference between Mac vs. iPhone. I'll post a follow up once I figure it out.
C++ On The iPhone
- bosshogg's blog
- Login or register to post comments