标签:gcd
-(void)loadData{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSString*str=[NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://1000phone.net:8088/app/iAppFree/api/appcate.php"] encoding:NSUTF8StringEncoding error:nil];
dispatch_async(dispatch_get_main_queue(), ^{
self.dataArray=[NSJSONSerialization JSONObjectWithData:[str dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil];
[self.tableView reloadData];
//结束下拉刷新
[self.refreshControl endRefreshing];
});
});
标签:gcd
原文地址:http://blog.csdn.net/heyachaodeios/article/details/45645607