我读过关于 CFRunLoop 但仍然有点困惑。我遇到了一段我想为自己澄清的代码:
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:[NSString stringWithFormat:url]]];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody:postData];
[[NSURLConnection alloc]initWithRequest:request delegate:self];
CFRunLoopRun();
那么,假设这一切都在主线程上调用,它会阻塞主线程吗?还是会通过 CFRunLoopRun() 函数调用产生一个新线程?
谢谢!