Re: Help Mixing Objective-C & Objective-C++
Re: Help Mixing Objective-C & Objective-C++
- Subject: Re: Help Mixing Objective-C & Objective-C++
- From: Jack Nutting <email@hidden>
- Date: Fri, 25 Feb 2011 09:18:39 +0100
On Thu, Feb 24, 2011 at 4:31 PM, James Bucanek <email@hidden> wrote:
> (3) Using an auxiliary structure to contain all of the implementation
> variables is a good alternative, but it has other drawbacks. First, it
> seriously pollutes all of the implementation code with pointer redirection
> through the ivar struct pointer, which I find both annoying and difficult to
> migrate later.
It occurs to me that the drawbacks to that approach don't have to be
so bad. Limit yourself to only using accessors for those ivars in the
structure, and make macros to let you define each getter and setter as
a one-liner in your implementation, and that should take care of most
of it.
I'd also like to toss in a sixth option: Tell Xcode to compile *all*
your code in Objective-C++ mode! I remember doing this on a large
project several years ago, and apart from the fact that compilation
was a lot slower, I don't remember having any other problems with this
approach.
--
// jack
// http://nuthole.com
// http://learncocoa.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden