1
NSURLConnection은 초기화 된 클래스에 메시지를 자동으로 보내거나 헤더 파일에서 NSURLConnection을 참조하지 않았기 때문에 어떻게 작동합니까?NSURLConnection은 대리자를 자동으로 선택합니까?
NSURLConnection은 초기화 된 클래스에 메시지를 자동으로 보내거나 헤더 파일에서 NSURLConnection을 참조하지 않았기 때문에 어떻게 작동합니까?NSURLConnection은 대리자를 자동으로 선택합니까?
아니, 당신은 URL Loading System Guide
// Create the request.
NSURLRequest *theRequest=[NSURLRequest
requestWithURL:[NSURL URLWithString:@"http://www.apple.com/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
// create the connection with the request
// and start loading the data
NSURLConnection *theConnection=[[NSURLConnection alloc]
initWithRequest:theRequest delegate:self];
합니다 (delegate:self
부분을 참고)에서이 예제와 같이 대리자를 지정해야합니다.
주의 사항 : NSURLConnection은 대리자를 유지합니다. 이것은 내가 과거에 꽤 중요한 두통을 일으켰다. – robinjam
고마워, 나는 이것을 메모 할 것이다! – TheLearner