ARC環境では、次のコードがあります。
NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:signature];
[invocation setTarget:delegate];
[invocation setSelector:@selector(restClient:loadedFile:contentType:eTag:)];
// Error Here!
[invocation setArgument:&self atIndex:2];
[invocation setArgument:&filename atIndex:3];
[invocation setArgument:&contentType atIndex:4];
[invocation setArgument:&eTag atIndex:5];
引数をインデックス2(&self
)に設定すると、次のコンパイラエラーが発生します。
* const__strong*をvoid型のパラメータに送信*保持/解放プロパティを変更
有効なコードを維持しながらこれを修正する方法がわかりません。現時点ではNULL
、invokeステートメントをtry / catchブロックに固定してラップしているだけですが、これは理想的とは言えない解決策です。
同様の問題、誰かがそれに対処するのに十分親切であるならば:
このコード行(MPOAuthライブラリから)
status = SecItemCopyMatching((__bridge CFDictionaryRef)searchDictionary, (CFTypeRef *)&attributesDictionary);
次のエラーが発生します
'CFTypeRef '(別名'const void * ')へのObjective-Cポインターへの間接ポインターのキャストはARCでは許可されていません