As i know, If retain count of a object goes to 0 its dealloc gets called.But i am getting retain count as -1. What does it mean?
I am using following code-
Demo *obj1 = [[Demo alloc] init];
NSString *s = [[NSString alloc] initWithString:@"mithilesh"];
NSString *s1 = [NSString stringWithString:s];
[s release];
object_setInstanceVariable(obj1, [propertyName cString], s1);
//printing retain count
NSLog(@"retain count of name = %i",[obj1.name retainCount]);
Output :
retain count of name = -1
String returned by method stringWithString: when get release ?