这部分看起来不对:
Performance * performanceItem = [[Performance alloc] init]; <--
performanceItem = [self.arrayOfPerformances objectAtIndex:i]; <--
NSString * sPerformanceDate = [performanceItem.sDate substringToIndex:10];
NSString * sCurrentDate = [CurrentDate dateDescription];
if([sPerformanceDate isEqualToString:sCurrentDate])
{
[arrayOfPerformancesForCurrentDate addObject:performanceItem];
}
[performanceItem release]; <--
您允许+in it performanceItem,但随后将其设置为arrayofpperformances中的对象,然后释放它(当它指向arrayofpperformances中的对象时)。
将该部分改为:
Performance *performanceItem = [self.arrayOfPerformances objectAtIndex:i];
NSString * sPerformanceDate = [performanceItem.sDate substringToIndex:10];
NSString * sCurrentDate = [CurrentDate dateDescription];
if([sPerformanceDate isEqualToString:sCurrentDate])
{
[arrayOfPerformancesForCurrentDate addObject:performanceItem];
}