I want to declare variables in objective-c that are available throughout an instantiated instance of a class, but not available outside the scope of that class. I have been doing my code as below:
@interface myClass
{
NSString* classVariable;
}
@end
@implementation myClass
-(void)method
{
NSLog(@"%@",classVariable);
}
@end
This seemingly works in the code, but I am new to Objective-c (coming from Java and C#). Is this best practice? Are there any pitfalls?
Thanks in advance!