Re: confused about ObjC vs C++ file naming conventions
Re: confused about ObjC vs C++ file naming conventions
- Subject: Re: confused about ObjC vs C++ file naming conventions
- From: Alastair Houghton <email@hidden>
- Date: Sat, 17 Oct 2009 22:42:46 +0100
On 17 Oct 2009, at 20:35, Jean-François Brouillet wrote:
That is, I want to put my C++ wrapper in the pch file, as in:
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "ObjCCPPWrappers.h"
#endif
with ObjCCPPWrappers.h containing:
struct AutoPool {
NSAutoreleasePool * pool ;
AutoPool() { pool = [[NSAutoreleasePool alloc] init] ; }
~AutoPool() { [pool release] ; }
} ;
Leaving aside my general dislike of the use of prefix headers other
than as a compile time optimisation (i.e. *I* think you should #import
your "ObjCCPPWrappers.h" header everywhere you use it... and then if
that means every ObjC++ file in your source code you might add it to
the prefix header to reduce compile times), you need
#ifdef __cplusplus
#import "ObjCCPPWrappers.h"
#endif
I think.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden