나는 ARC로 놀기 시작했으며, 내가 시도한 첫 번째 실험 중 하나는 URL에 HTTP 호출을하고 데이터를 다시 얻는 것이었다. ARC와ARU로 NSURLConnection sendSynchronousRequest
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *responseCode = nil;
NSData *oResponseData = [NSURLConnection sendSynchronousRequest:request returningResponse:responseCode error:error];
내가 마지막 줄에 컴파일러 오류와 경고를 얻을 활성화 : 그 내가 좋아하는 sendSynchronousRequest
을 사용하는 내 "고토"에 갔다 의미 때문에 물론, HTTP 상태 코드는 나에게 중요하다.
오류 :
Implicit conversion of an Objective-C pointer to 'NSURLResponse *__autoreleasing *' is disallowed with ARC
Implicit conversion of an Objective-C pointer to 'NSError *__autoreleasing *' is disallowed with ARC
file://localhost/Users/jason/Projects/test/Data/DataService.m: error: Automatic Reference Counting Issue: Implicit conversion of an Objective-C pointer to 'NSURLResponse *__autoreleasing *' is disallowed with ARC
file://localhost/Users/jason/Projects/test/Data/DataService.m: error: Automatic Reference Counting Issue: Implicit conversion of an Objective-C pointer to 'NSError *__autoreleasing *' is disallowed with ARC
경고 :
I는 기준 통과를 무엇을 말할 수에서Incompatible pointer types sending 'NSHTTPURLResponse *_strong' to parameter of type 'NSURLResponse *_autoreleasing *'
Incompatible pointer types sending 'NSError *_strong' to parameter of type 'NSError *_autoreleasing *'
이를 망치는 무엇이지만, 내가 무엇을 올바른 방법으로 확실치 이 문제를 해결하십시오. ARC와 비슷한 작업을 수행하는 "더 나은"방법이 있습니까?
LOL ... 공휴일 이후에 생각하려고하는 나를 도와줍니다! –