__OBJC__ equivalent for Objective-C++


__OBJC__ equivalent for Objective-C++



I'm compiling a .mm file (Objective-C++) for an iPhone application, and the precompiled header fails to include the base classes.

I tracked it down to the following:

#ifdef __OBJC__     #import <Foundation/Foundation.h>     #import <UIKit/UIKit.h> #endif 

Turns out, __OBJC__ is undefined for mm files, whereas it is defined for standard m files.

Is there any other flag I can use instead?


Creating the Iphone MapKit showUserLocation Ring Annimation

1:

Upload and download data from server with Cocoa Touch?
If you invoke gcc with -dM -E it will stop after preprocessing, and list all #defines . How do I lock the orientation to portrait mode in a iPhone Web Application?This normally how I check what built-in defines are set; however I just tried this with a test .mm file and __OBJC__ is defined for me, so I'm not sure why it isn't defined for you.. How do I make a button play sounds in a certain order using an array?
$ echo "int foo() {};" > tmp.mm $ gcc -dM -E tmp.mm|grep OBJ #define __OBJC__ 1 #define OBJC_NEW_PROPERTIES 1 
How to assign copy of object back to original reference?

80 out of 100 based on 35 user ratings 790 reviews

#