Null passed to a callee that requires a non-null argument

后端 未结 1 892
一个人的身影
一个人的身影 2021-01-20 04:03

I have been using this to convert a CIImage to NSData for ages:

  NSData *data = [imageRep representationUsingType: NSPNGFileType
                                    


        
相关标签:
1条回答
  • 2021-01-20 04:36

    Is this the correct way to solve this problem?

    Yes.

    There appear to be a few places in the API which accepted nil values rather than an empty collection even though it was not documented as valid. The non-nil annotations added by Apple to better support inter-working with Swift are just highlighting these.

    0 讨论(0)
提交回复
热议问题