• 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: 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


  • Follow-Ups:
    • Re: confused about ObjC vs C++ file naming conventions
      • From: Jean-François Brouillet <email@hidden>
References: 
 >confused about ObjC vs C++ file naming conventions (From: Jean-François Brouillet <email@hidden>)

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