しばらくこれと戦ってきました。基本的には、画像をNSDataに変換して、サーバーに送信できるようにします。以前に使用したコードですが、何らかの理由でこれでARCエラーが発生します。エラーは、imageData変数を宣言した行に表示されます。
注:myImageはメソッドに渡されます。
- (void)uploadImage:(NSImage *)myImage {
NSData *imageData = UIImageJPEGRepresentation(myImage, 1.0);
// Do something...
}
エラーと2つの警告が表示されます
Error: Implicit conversion of 'int' to 'NSData *' is disallowed with ARC
Warning: Implicit declaration of function 'UIImageJPEGRepresentation' is invalid in C99
Warning: Incompatible integer to pointer conversion intializing 'NSData * __strong' with an expression of type 'int'
何か案は?