• 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: Help Mixing Objective-C & Objective-C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Help Mixing Objective-C & Objective-C++
      • From: Sean McBride <email@hidden>
References: 
 >Re: Help Mixing Objective-C & Objective-C++ (From: Andreas Grosam <email@hidden>)
 >Re: Help Mixing Objective-C & Objective-C++ (From: James Bucanek <email@hidden>)

  • Prev by Date: Re: IBOutlet to different classes, conditional build
  • Next by Date: Re: NSNumberFormatter issue with method -setLocale
  • Previous by thread: Re: Help Mixing Objective-C & Objective-C++
  • Next by thread: Re: Help Mixing Objective-C & Objective-C++
  • Index(es):
    • Date
    • Thread