Take this code :
@interface SomeClass:NSObject
{
@private
NSString* Size;
}
@property NSString* Size;
@end
--------------------------
@implementation SomeClass
@synthesize Size;
- (void) something
{
Size = @"syntax error : Expected identifier or '(' ";
self.Size = @"works ok";
}
@end
Why is this a syntax error? Is "Size" a reserved word or already defined in NSSObject ? I'm getting the error on two separate projects...
Size is a type:
typedef long Size;
Dont use it, and you should follow the Objective-C conventions, which are to name the properties with lowerCase.
Did you option-Click or cmd+Click on Size (not self.Size)?
X Code should tell you that it is declared in MacTypes.h as typedef long Size;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With