Why are my @private instance variables public?
Why are my @private instance variables public?
- Subject: Why are my @private instance variables public?
- From: Matt Gough <email@hidden>
- Date: Thu, 12 Aug 2004 16:41:35 +0100
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.