0

我想使用豆瓣提供的一些api,所以我想知道如何让我的ipad模拟器连接互联网。有人愿意帮我这个忙吗?

-(IBAction)testParsingXml:(id)sender
{

NSURL *url = [NSURL URLWithString:@"GET http://api.douban.com/book/subjects? tag=cowboy&start-index=1&max-results=2apikey={0a80c344758f3bfa1f8249cd60adb3ee}"];


NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSLog(@"%@",data);

}
4

0 回答 0