• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: confused about ObjC vs C++ file naming conventions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: confused about ObjC vs C++ file naming conventions


  • Subject: Re: confused about ObjC vs C++ file naming conventions
  • From: Jean-François Brouillet <email@hidden>
  • Date: Sun, 18 Oct 2009 01:39:51 +0100

Many Thanks! That solved the problem.
Best Regards
--
JFB

On 17 Oct 2009, at 22:42, Alastair Houghton wrote:

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
References: 
 >confused about ObjC vs C++ file naming conventions (From: Jean-François Brouillet <email@hidden>)
 >Re: confused about ObjC vs C++ file naming conventions (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: confused about ObjC vs C++ file naming conventions
  • Next by Date: Struts on Xcode
  • Previous by thread: Re: confused about ObjC vs C++ file naming conventions
  • Next by thread: Interface Builder Crash at startup (3.2.1)
  • Index(es):
    • Date
    • Thread