का कारण बनता है एक एआरसी वातावरण में, मैं निम्नलिखित कोड है:प्रकार रूपांतरण संकलक त्रुटि
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
) करने के लिए तर्क की स्थापना निम्नलिखित संकलक त्रुटि होती है:
Sending *const __strong * to parameter of type void * changes retain/release properties
मुझे नहीं पता कि वैध कोड रखने के दौरान इसे कैसे ठीक किया जाए। फिलहाल मैं NULL
में चिपक रहा हूं और आवेदक कथन को एक कोशिश/पकड़ ब्लॉक में लपेट रहा हूं, लेकिन यह एक आदर्श से कम समाधान है।
ऐसा ही एक मुद्दा है, किसी को भी तरह पर्याप्त होगा अगर यह रूप में अच्छी तरह पता करने के लिए: कोड की इस पंक्ति (MPOAuth पुस्तकालय से)
status = SecItemCopyMatching((__bridge CFDictionaryRef)searchDictionary, (CFTypeRef *)&attributesDictionary);
मैं निम्नलिखित त्रुटि मिलती है साथ
Cast of an indirect pointer to an Objective-C pointer to 'CFTypeRef ' (aka 'const void *') is disallowed with ARC
क्या कोई विशेष कारण है कि आप यहां एक ब्लॉक के बजाय एनएसआईएनवोकेशन का उपयोग क्यों करना चाहते हैं? – NSResponder
मुझे यकीन नहीं है, यह ड्रॉपबॉक्स एसडीके का हिस्सा है। मैं इसे एआरसी-अनुपालन बनाने के माध्यम से जा रहा हूं, कोड को गड़बड़ न करने की कोशिश कर रहा हूं। – FeifanZ