• home
  • products
  • bosshogg's blog
  • forums
  • about
  • contact us
Home › Blogs › bosshogg's blog

User login

  • Create new account
  • Request new password

C++ On The iPhone

bosshogg — Sun, 11/29/2009 - 21:53

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.

  • bosshogg's blog
  • Login or register to post comments

Navigation

  • Forums
  • Recent posts
  • Feed aggregator

New forum topics

  • Crash on 10,000 Lite Version 1.6
  • Crash on 1st gen iPhone, looking for iAd framework
  • One thing missing...
  • Hello from my iPad
  • Welcome NetDetective Users!
more

Recent blog posts

  • How the iPad Killed Our iPhone App Sales
  • Sending email from within iPhone apps
  • iPhone Tie Down Calculator Created for Pacific Cargo Control
  • My Opinings On The iPad
  • Plug For A Good Small Company
  • Gambling Planet Features Three Jacks Games
  • Twist Tac Toads Available in the AppStore!
  • Getting the Version String
  • Your iPhone App Icon
  • C++ On The iPhone
more

© Copyright 2009. All rights reserved.

  • home
  • products
  • bosshogg's blog
  • forums
  • about
  • contact us