UIGraphicsBeginImageContextWithOptions显示严重错误

时间:2015-03-18 05:42:17

标签: ios objective-c core-graphics uigraphicscontext xcode-6.2

-(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

0 个答案:

没有答案