在我的课堂上,我创建了一个 CBUrlConnection:
urlConnection = [NSURLConnection connectionWithRequest:request delegate:self];
[urlConnection start];
但我没有得到任何回应,这些委托方法永远不会被调用:
- (void)connection:(NSURLConnection *)connection didFinishLoadingData:(NSData *)data error:(NSError *)error
- (void)connection:(NSURLConnection *)connection didUpdateProgress:(CGFloat)percent
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
请求似乎是正确的,服务器 url 肯定是正确的,并且服务器工作正常。有什么问题?