Hi there,
I've created a static getter-function:
@implementation MyClass
static int aValue = 1;
+ (int) aValue { return aValue; }
// other stuff here
@end
and now I'm trying to access it in some different ways from another class:
@implementation AnotherClass
- (void) aMethod {
if (MyClass.aValue > 0) { NSLog(@"Foobar"); } // No parser error
if ((MyClass.aValue > 0)) { NSLog(@"Foobar"); } // My parser doesn't like that
if (([MyClass aValue] > 0)) { NSLog(@"Foobar"); } // This is ok again
if ((0|MyClass.aValue > 0)) { NSLog(@"Foobar"); } // Gives a warning, but works
}
// other stuff here
@end
As you can see the parser seems to have problems with static methods in nested boolean expressions, which is quite unfortunate, if you want to use &&, || and similar clauses.
The full Xcode error message is "Expected ')' before the '.' token". Can someone explain the parser behaviour to me? Am I missing something important or is this a bug?
Le Torbi