NSURLConnection
和有什么区别NSURL
?
我的意思是,如果我正在下载一个文件,它会影响我使用哪个文件吗?
Rgds
为了:
NSString *myUrl = @"http://www.test.com/";
NSString *returnData = [NSString stringWithContentsOfURL:[NSURL URLWithString: myUrl]];
或者
NSString *myUrl = @"http://www.test.com/";
NSURLRequest *myRequest = [[NSURLRequest alloc] initWithURL: [NSURL URLWithString:myUrl] ];
NSString *returnData = [NSURLConnection sendSynchronousRequest:myRequest returningResponse: nil error: nil ];
有什么不同?
谢谢