0
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    ClassCell *cell = (ClassCell *)[collectionView cellForItemAtIndexPath:indexPath];

    UIGraphicsBeginImageContextWithOptions(cell.frame.size, NO, [UIScreen mainScreen].scale);

    ...
}

在选择集合视图单元格时,此行会导致错误:(我添加了符号断点 CGPostError来解决这个问题)

> <Error>: CGBitmapContextCreateImage: invalid context 0x0. This is a
> serious error. This application, or a library it uses, is using an
> invalid context  and is thereby contributing to an overall degradation
> of system stability and reliability. This notice is a courtesy: please
> fix this problem. It will become a fatal error in an upcoming update.
> 
> <Error>: CGContextConcatCTM: invalid context 0x0. This is a serious
> error. This application, or a library it uses, is using an invalid
> context  and is thereby contributing to an overall degradation of
> system stability and reliability. This notice is a courtesy: please
> fix this problem. It will become a fatal error in an upcoming update.
> 
> <Error>: CGContextSetInterpolationQuality: invalid context 0x0. This
> is a serious error. This application, or a library it uses, is using
> an invalid context  and is thereby contributing to an overall
> degradation of system stability and reliability. This notice is a
> courtesy: please fix this problem. It will become a fatal error in an
> upcoming update.
> 
> <Error>: CGContextDrawImage: invalid context 0x0. This is a serious
> error. This application, or a library it uses, is using an invalid
> context  and is thereby contributing to an overall degradation of
> system stability and reliability. This notice is a courtesy: please
> fix this problem. It will become a fatal error in an upcoming update.
> 
> <Error>: CGBitmapContextCreateImage: invalid context 0x0. This is a
> serious error. This application, or a library it uses, is using an
> invalid context  and is thereby contributing to an overall degradation
> of system stability and reliability. This notice is a courtesy: please
> fix this problem. It will become a fatal error in an upcoming update.
> 
> <Error>: CGContextConcatCTM: invalid context 0x0. This is a serious
> error. This application, or a library it uses, is using an invalid
> context  and is thereby contributing to an overall degradation of
> system stability and reliability. This notice is a courtesy: please
> fix this problem. It will become a fatal error in an upcoming update.
> 
> <Error>: CGContextSetInterpolationQuality: invalid context 0x0. This
> is a serious error. This application, or a library it uses, is using
> an invalid context  and is thereby contributing to an overall
> degradation of system stability and reliability. This notice is a
> courtesy: please fix this problem. It will become a fatal error in an
> upcoming update.
> 
> <Error>: CGContextDrawImage: invalid context 0x0. This is a serious
> error. This application, or a library it uses, is using an invalid
> context  and is thereby contributing to an overall degradation of
> system stability and reliability. This notice is a courtesy: please
> fix this problem. It will become a fatal error in an upcoming update.

我用这条线错了吗?

UIGraphicsBeginImageContextWithOptions(cell.frame.size, NO, [UIScreen mainScreen].scale);

我正在使用 Xcode 6.2

4

0 回答 0