Reputation: 91
I got a problem when analyzing my code below :
NSDate *formatterDate = [inputFormatter dateFromString:smBook.time_limit];
formatterDate = [formatterDate initWithTimeInterval:1*24*60*60 sinceDate:formatterDate];
The message is : Incorrect decrement of the reference count of an object that is not owned at this point by the caller .
Can anyone tell me the reason why ?
Upvotes: 0
Views: 114
Reputation: 3918
It seems that the message not occurring from the above line please check the whole class in or enable zombie objects from edit schemes of your project
Upvotes: 0
Reputation: 17186
Change below line:
formatterDate = [formatterDate initWithTimeInterval:1*24*60*60 sinceDate:formatterDate];
with this line:
NSDate *newDate = [[NSDate alloc] initWithTimeInterval:1*24*60*60 sinceDate:formatterDate];
Release this newDate when you are doe with your operations.
Upvotes: 1