无需其他类库

1: - (IBAction)callapi:(id)sender {
];
   3:     NSURLRequest *request=[NSURLRequest requestWithURL:url];
   4:     [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
//json
   6:         NSDictionary *r=[NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];
int cnt=[r count];
,cnt);
,cnt];
  10:  
//string
//NSString *str=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//NSLog(str);
//[self resultlbl].text=r[0][0];
  15:     }];
  16: }

相关文章:

  • 2022-12-23
  • 2021-12-22
  • 2021-12-19
  • 2021-07-26
  • 2021-09-20
  • 2022-12-23
  • 2021-07-09
猜你喜欢
  • 2021-11-14
  • 2022-01-03
  • 2021-12-21
  • 2022-12-23
  • 2021-09-25
  • 2021-04-13
  • 2022-02-23
相关资源
相似解决方案