• 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: Obj-C private and XCode 2.3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obj-C private and XCode 2.3


  • Subject: Re: Obj-C private and XCode 2.3
  • From: Bill Bumgarner <email@hidden>
  • Date: Wed, 24 May 2006 08:57:11 -0700

On May 24, 2006, at 1:49 AM, Jean-Daniel Dupas wrote:
I have installed XCode 2.3 and i have a problem with a piece of code.
I'have two classes like this:

@interface MyClass : NSObject {
@private
	id sd_delegate;

@interface MySubClass : MyClass {
@private
	id sd_delegate;

With XCode 2.2.1, private ivar from superclass was hidden in subclasses @interface (and @implementation), and it compile well, but with XCode 2.3 it appears that private ivars are only hidden in subclasses @implementation and i get this error: duplicate member 'sd_delegate'.

Gcc invocation look like this:

.....
Is this a last gcc version bug, or was this a gcc 4.0 bug?

Which XCode version was right?

Xcode 2.3 is exhibiting the correct behavior. The compiler fixed a bug where it wasn't warning about variable hiding in certain Objective-C contexts, this one included.


As Joar indicated, instance variables of the same name within a particular inheritance path through the class hierarchy isn't considered correct code. It also breaks KVO/KVC.

b.bum
_______________________________________________
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: 
 >Obj-C private and XCode 2.3 (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Debugger Break on Attach
  • Next by Date: Re: Debugger Break on Attach
  • Previous by thread: Re: Obj-C private and XCode 2.3
  • Next by thread: Time to split the documentation from the Xcode installer?
  • Index(es):
    • Date
    • Thread