I am checking Day objects in my schedule Dictionary and want to know what to do about the Day pointer when I'm done. Build and Analyze doesn't complain about it, but it just sits there taunting me. I feel like it's just sitting there when the function finishes and maybe even a new one gets created each time through the loop. Also, when releasing day each time through the loop I end up releasing the original object. Any ideas?
- (NSUInteger) showsInTheNext:(NSUInteger)days {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyyLLdd"];
if(days == 0) days = 91;
NSUInteger shows = 0;
for (NSUInteger x = 0; x < days; x++)
{
Day *day = [self.schedule objectForKey:[dateFormatter stringFromDate:[self.date addTimeInterval:60*60*24*x]]];
if((day != nil) && ([day.type isEqualToString:@"Show"])) shows++;
//[day release];
}
[dateFormatter release];
return shows;
}