Hey, I've been wokring through my app and removing the memory leaks but the below one has me beaten, any help would be much appreciated.
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateFormat:@"dd/MM/yyyy"];
claim.date = [dateFormatter dateFromString:[data objectForKey:key]];
[dateFormatter release];
The date property is defined as:
@property (nonatomic, retain) NSDate *date
Thanks
Edit:
Forgot to mention where the memory leak occurred, its on line claim.date = [dateFo开发者_开发技巧rmatter dateFromString:[data objectForKey:key]];
I suspect one or both of the following:
- The owner of
claim
never released it - The implementation of
claim
does not send the release message todate
in itsdealloc
and/or does notself.date = nil
in theviewDidUnload
.
精彩评论