iOS 8.1 crash (EXC_BAD_ACCESS) : : ImageIO: CGImageReadGetBytesAtOffset : *** ERROR *** CGImageSource was created with data size:

前端 未结 3 825
無奈伤痛
無奈伤痛 2021-01-28 02:16

Appreciate any help fixing a crash (EXC_BAD_ACCESS) in my iOS app. I am seeing this since updating my app to iOS 8, using latest available iOS 8.1.2. The same code worked fine i

3条回答
  •  遥遥无期
    2021-01-28 02:50

    First of all sorry for the late answer but maybe it will help someone with a same problem. Main reason is that imageIO cant load image as fast as you need for my example i was reordering UITableViewCell. Maybe It will help someone with his logics. And try to load Image into NSData and then convert to UIImage.

    For example in cellForRowAtIndexPath

      let image = UIImagePNGRepresentation(self.imageArray[indexPath.row])
      let returnImage = UIImage(data: image)
    

    So if you load returnImage into imageIO func or func which uses CGContext, try to give the value returnImage

提交回复
热议问题