<分区>
标签 ios afnetworking
<分区>
我想知道我是否可以等待使用 afnetworking 处理请求。
假设我得到了这个方法
- (MWPhoto *)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {
//Request goes here, so the method doesn't return anything before it's processed
}
这可行吗?
最佳答案
这将被称为同步请求。
如果在主线程上调用该方法,它会使您的应用程序看起来已卡住,这不是建议的联网方式。
如果您仍想这样做,请参阅我评论的重复问题以获取有关如何操作的详细信息。
关于ios - 等待请求被处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18879854/