웹 API에서 작은 비트의 데이터 (약 50 바이트)를 얻으려고 NSURLRequest
및 NSURLConnection
을 사용하려고합니다. 나는 아래의 코드가 옳다는 것을 확신하지만, 실제로 수신 된 데이터를 얻고 그 데이터가 모두 다운로드 될 때 어떻게 감지합니까?NSURLConnection이 완료되었을 때를 감지하는 방법
NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://google.com"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
NSURLConnection *con = [[NSURLConnection alloc] initWithRequest:req delegate:self];
문서 페이지 [여기] (http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html) – bobobobo