Whats the difference between these two:
@interface MyClass ()
{
BOOL newUser;
}
Or
@implementation MyClass
{
BOOL newUser;
}
@end
Whats the difference between these two:
@interface MyClass ()
{
BOOL newUser;
}
Or
@implementation MyClass
{
BOOL newUser;
}
@end
variables declared in your interface, as in 1., are visible in other classes that instantiate objects of MyClass. The variable declared in 2. will only be visible inside of MyClass. Here is something you should read: http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/
EDIT: @JoshCaswell is right. 1. is an anonymous category. Its varaibles will be seen depending on where the interface is declared. a better link to read about this is: http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html