I have the following code in my class method for a test:
NSMutableDictionary * temp = [[NSMutableDictionary alloc] init]; [temp setObject:@"4" forKey:@"Interval"]; interval = [temp objectForKey:@"Interval"]; [temp release];
interval is my instance variable:
NSString * interval;
and getter method for it (this is not a property):
- (NSString *) getInterval { return interval; }
In some other class, I am trying to use the getInterval method as follows:
NSString * test = [MyObject getInterval];
getInterval returns me the correct value 4, I see it in the debugger. I cannot understand, because, as I understand it, a pointer to an interval instance variable must be free using the NSMutableDictionary temp parameter. Why it happens?
source share