以下代码在Chrome中有效但在IE中无效
NSDictionary *products=[jSONData valueForKey:@"products"];
NSDictionary *product=[products valueForKey:@"product"];
NSString *name=[product objectForKey:@"name"];
在try catch块中抛出无效参数的错误 请建议解决方案
答案 0 :(得分:3)
我认为问题是:checked selector,即not supported in IE8
NSString *oauthParameters = authHeaders[@"X-Verify-Credentials-Authorization"];
NSString *urlString = authHeaders[@"X-Auth-Service-Provider"];
NSMutableURLRequest *request =
[NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
request.allHTTPHeaderFields = @{@"Authorization":oauthParameters};
[request setHTTPMethod:@"GET"];
NSOperationQueue *queue = [[NSOperationQueue alloc]init];
[NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response,NSData *data,NSError *error){
NSDictionary *twitterData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:NULL];
}];
答案 1 :(得分:0)