在Xcode 7,iOS 9中运行我的应用程序时出现EXC_ARITHMETIC错误.但它在下载版本中运行良好(Xcode 6.4,iOS 8.4)
请在下面找到代码
UICollectionViewFlowLayout *flowlayout = (UICollectionViewFlowLayout *)self.collectionViewLayout;
NSUInteger count = _tripButtons.count;
for (NSUInteger i = 0; i < count; ++i)
{
UIView *tripButton = [_tripButtons pointerAtIndex:i];
if (tripButton)
{
CGRect frame = tripButton.frame;
// Getting error with below line
UICollectionViewLayoutAttributes *layout = [flowlayout layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]];
frame.origin.x = layout.frame.origin.x;
frame.origin.y = layout.frame.origin.y;
tripButton.frame = frame;
}
}
Run Code Online (Sandbox Code Playgroud)
我对这个错误很困惑.这个错误是由于我的代码中的错误还是由于我的升级造成的.请指导我......