如何在使用JSON加载数据并输入标签时显示微调器?
使用此代码调用JSON并将值放在标签中:
-(void)loadJSON {
NSString *urlString = [NSString stringWithFormat:@"http://www.abc.com/service/?id=John&response=json"];
NSURL *url = [NSURL URLWithString:urlString];
data = [NSData dataWithContentsOfURL:url];
NSError *error;
json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSDictionary *loan = [json objectForKey:@"person"];
labelFirstName.text=[loan objectForKey:@"firstName"];
labelLastName.text = [loan objectForKey:@"lastName"];
labelNickName.text = [loan objectForKey:@"nickName"];
}