时间:2010-07-23 15:56:02

标签: iphone delegates nsurlconnection

5 个答案:

答案 0 :(得分:27)

答案 1 :(得分:15)

尝试在主线程上运行连接:

NSURLConnection * connection = [[NSURLConnection alloc] initWithRequest:request
                                         delegate:self startImmediately:NO];

[connection scheduleInRunLoop:[NSRunLoop mainRunLoop] 
            forMode:NSDefaultRunLoopMode];
[connection start];

答案 2 :(得分:4)

答案 3 :(得分:1)

答案 4 :(得分:1)

我认为您的类头文件中可能遗漏了NSURLConnectionDelegate

例如:

@interface yourClass : NSObject <NSURLConnectionDelegate>