现在我正在我的iOS应用程序中发布POST,而在POST中我有这个
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES]; // Edited
这样- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
将被调用,但它已经完成,但是没有使用连接会发出警告,我知道这不是调用它的正确方法,所以我怎么能声明一个连接呢是didRecieveRespose
和didReceiveData
?
由于
答案 0 :(得分:2)
您可以这样声明: -
(void) [[NSURLConnection alloc] initWithRequest:request delegate:self];
或
[NSURLConnection connectionWithRequest:request delegate:self];