我有错误 - CoreDate 无法完成从.. 检索数据的错误。应用程序Item *currentItem = (Item *)[self.fetchedObjectsArray objectAtIndex:currentItemIndex]
在下面的代码中立即崩溃。但是,它确实显示了几个提要,然后崩溃了。重现错误也很困难,即使它确实被重现,它也会在收到不同数量的提要后崩溃。有谁知道我将如何调试这样的问题?
- (void) showNextFeed {
if ([self.fetchedObjectsArray count] <= 0)
return;
if (feedAnimating)
return;
feedAnimating = YES;
//start off the left of the screen
self.newsTitleView.center = CGPointMake(-self.newsTitleView.frame.size.width * 0.5, self.newsTitleView.center.y);
//start off the right of the screen
self.newsItemTitleLabel.center = CGPointMake(self.view.frame.size.width + self.newsItemTitleLabel.frame.size.width * 0.5, self.newsItemTitleLabel.center.y);
//update the content
currentItemIndex = (currentItemIndex + 1 < [self.fetchedObjectsArray count]) ? (currentItemIndex + 1) : 0;
Item *currentItem = (Item*)[self.fetchedObjectsArray objectAtIndex:currentItemIndex];
self.newsTitleView.backgroundColor = [UIColor colorWithHexString:currentItem.belongsTo.color];
self.newsFeedTitleLabel.text = currentItem.belongsTo.feedTitle;
self.newsItemTitleLabel.text = currentItem.itemTitle;