I\'ve got a very basic example where I\'m reading some data into a class from JSON, and my objects are getting corrupted somehow. I suspect I\'m missing some detail about how pr
The answer is simple, you defined NSArray *_references as a static variable not as a private variable. To do that
@implementation ANBNote{
NSArray * _references;
}
In addition to this as of Xcode 4 you do not have to define _references object in the implementation file. You may just set a variable in the header file and then access its private accessor by just typing _
before the name of it.
For instance
@interface ANBNote
@property(strong , nonatomic) NSArray *references;
@end
@implementation ANBNote
-(id) initWithArray:(NSArray *) ar{
if(self)
_references = [NSArray arrayWithArray:ar];
return self;
}
@end