来自 iPhone SDK 中数据库的 URL 链接



如何在iPhone SDK中获取存储在数据库中的urllink数据?

使用以下代码可能会对您有所帮助。

    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"Your URL"]]];
    // Perform request and get JSON as a NSData object
    NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSLog(@"Your Data=%@",response);
    id jsonObject = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingAllowFragments error:nil];

最新更新