Objective c NSURLConnection sendSynchronousRequest未阻塞

Objective c NSURLConnection sendSynchronousRequest未阻塞,objective-c,ios,nsurlconnection,nsoperation,Objective C,Ios,Nsurlconnection,Nsoperation,我正在NSOperation中调用NSURLConnection-sendSynchronousRequest,但该方法立即返回。我希望它会阻止操作,直到收到所有数据。这是我的误解吗?将NSURLConnection对象的委托设置为self NSURLConnection*theConnection=[[NSURLConnection alloc]initWithRequest:theRequest委托:self] 然后实现ConnectiondFinishLoading方法 -(void)连接

我正在NSOperation中调用
NSURLConnection
-
sendSynchronousRequest
,但该方法立即返回。我希望它会阻止操作,直到收到所有数据。这是我的误解吗?

将NSURLConnection对象的委托设置为self
NSURLConnection*theConnection=[[NSURLConnection alloc]initWithRequest:theRequest委托:self]
然后实现ConnectiondFinishLoading方法
-(void)连接dFinishLoading:(NSURLConnection*)连接{
//你的代码

}

您能否提供更多信息,最好是代码?请提供您的NSOperation代码(特别是-main方法)以了解您实际在做什么。 NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; -(void)connectionDidFinishLoading:(NSURLConnection *)connection{ //your code }