0
votes

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 ?

2
We need more code, and we need to know whether you're using ARC, Garbage Collection, or manual Reference Counting.fzwo

2 Answers

1
votes

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.

0
votes

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