Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios7 如何在后台线程上使用AFNetworking?_Ios7_Background Process_Afnetworking 2 - Fatal编程技术网

Ios7 如何在后台线程上使用AFNetworking?

Ios7 如何在后台线程上使用AFNetworking?,ios7,background-process,afnetworking-2,Ios7,Background Process,Afnetworking 2,我有一个应用程序目前正在使用AFNetworking 1.0从REST Web服务同步数据 当前通过点击UI上的按钮进行同步时,会阻止UI 我正在升级应用程序以使用AFNetworking 2.0 如何在后台线程上进行同步,使UI不会暂停?您是否尝试过以下方法: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://gowalla.com/users/mattt.json"]]; A

我有一个应用程序目前正在使用AFNetworking 1.0从REST Web服务同步数据

当前通过点击UI上的按钮进行同步时,会阻止UI

我正在升级应用程序以使用AFNetworking 2.0

如何在后台线程上进行同步,使UI不会暂停?

您是否尝试过以下方法:

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://gowalla.com/users/mattt.json"]];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
    NSLog(@"Name: %@ %@", [JSON valueForKeyPath:@"first_name"], [JSON valueForKeyPath:@"last_name"]);
} failure:nil];
检查以下链接

这方面还没有帮助吗?请显示您的代码