If i don't use an ivar for properties, but do this:
@interface someClass : NSObject
@property (nonatomic, retain) NSArray * someArray;
@end
@implementation someClass
@synthesize someArray = _someArray;
- (void) someMethod
{
if( self.someArray == nil ){
// True on the first call?
}
}
@end
The first time I check self.someArray
it returns nil
, as does _someArray
, but is this guaranteed? I read only that ivars are guaranteed to be nil
, and since I don't declare a ivar (_someArray
is not an ivar), I am not sure if it will be nil
everywhere and every time.