iOS 请求数据或者上传头像的时候卡UI界面
2016-04-11 15:41
323 查看
今天碰到了一个问题,就是上传头像的时候,头像没有上传完全,点击事件里面的功能没办法实现,比如想加个提示框,都是在图片上传完成后才会弹出提示框,这就需要加上异步线程,代码如下:
dispatch_async(dispatch_get_global_queue(0, 0), ^{ // 耗时的代码放到这里面 //通知主线程刷新 dispatch_async(dispatch_get_main_queue(), ^{ 回调刷新 }); });
相关文章推荐
- UIImageView实现图片平铺
- HDOJ 2767 Proving Equivalences
- java中queue的使用
- Access restriction: The type 'BASE64Encoder' is not API (restriction on required library 'D:\Java\jd
- WEB界面设计中太原UI设计师讲何为网格布局设计?
- iOS-UIImagePickerController 内存警告研究
- iOS学习笔记10-UIView动画
- windows下安装requests
- 改变UIView 的位置 Center和Frame
- UItableview控件数据刷新,指定行刷新
- IOS如何给VIEW设置2个圆角?set cornerRadius for only top-left and top-right corner of a UIVIEW
- 1007. Maximum Subsequence Sum (25)
- 跑马灯效果
- iOS开发之UIWindow,iOS程序启动
- JAVA学习---集合系列---PriorityQueue
- Xcode:使用agvtool 自动化操作version and Build Numbers 的步骤
- Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005
- Android Studio 从git 服务器下载最新的build, Update Project
- - (void)performSegueWithIdentifier:(NSString *)identifier sender:(nullable id)sender 失效
- 尺取法 POJ 3061 Subsequence