asynchornus 요청을 구현하려고합니다. 나는 내 연구를하고이 내가 가진 최고의하지만 코드는 내가 내 .H 파일에 NSURLConnectionDelegate
을 추가 한비동기 요청 생성
NSURL *url2 = [NSURL URLWithString:@"www.google.com"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url2];
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[NSURLConnection sendAsynchronousRequest:urlRequest queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
{
if ([data length] > 0 && error == nil)
[delegate receivedData:data];//i get the error here use of undeclared identifier 'delegate' ,when I put self insead I receive the error : no visible @interface for "my class name" declares the selector "received data"
else if ([data length] == 0 && error == nil)
[delegate emptyReply];//same error here
else if (error != nil && error.code == ERROR_CODE_TIMEOUT) //the error here is "use of undelcared identifier ERROR_CODE_TIMEOUT
[delegate timedOut];//error here is save as the first one
else if (error != nil)
[delegate downloadError:error];//error here is save as the first one
}];
에 대한 해결책을 찾을 수없는 오류로 가득하다
누군가는 말해 줄 수 오류가 무엇입니까? 필요에 따라 대리자 메서드를 구현 : 대표 : initWithRequest -
덕분에
당신이 당신의 결과를 붙여 주실 래요? –