• 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: Why are my @private instance variables public?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why are my @private instance variables public?


  • Subject: Re: Why are my @private instance variables public?
  • From: Matt Gough <email@hidden>
  • Date: Fri, 13 Aug 2004 09:35:06 +0100

rdar://3761423


On Aug 12, 2004, at 4:41 pm, Matt Gough wrote:

I have just noticed that the @private instance variables of one of my classes are being treated as though they are @public. Does anyone know why this could be?

I tried replicating the problem in a new project, but couldn't.


After further investigation....

It seems as though the @private variables are public when compiling with Obj-C++, not plain Obj-C

A simple test case:

@interface Foo
	{
@private
	unsigned cacheValue;
	}
@end

@interface Bar : Foo
@end

@implementation Bar
-(void)someMethod
	{
	if (cacheValue == 7) // Allowed when compiling with Obj-c++
		;
	}
@end


Is there a compiler setting I need to twiddle?

Matt Gough
Softchaos Limited
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Why are my @private instance variables public? (From: Matt Gough <email@hidden>)

  • Prev by Date: Re: Xcode 1.5 and header files
  • Next by Date: Re: Xcode 1.5 - how to select Find results?
  • Previous by thread: Why are my @private instance variables public?
  • Next by thread: Which project files need to be checked in ?
  • Index(es):
    • Date
    • Thread