I am doing some work on reference count increase. Below is the sample.
.h file.
@property (nonatomic, retain) NSString *s1;
.m file
@synthesize s1;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
s1 = [[NSString alloc] init];
NSLog(@"%d",[s1 retainCount]);
[s1 retain];
NSLog(@"%d",[s1 retainCount]);
[s1 copy];
NSLog(@"%d",[s1 retainCount]);
}
When i am finding reference count, it is showing -1 for all of them, and i am bit confused for this, please help me.