一,工程图。

二,代码。

RootViewController.h

#import <UIKit/UIKit.h>
//加入头文件
#import "MBProgressHUD.h" @interface RootViewController : UIViewController
<MBProgressHUDDelegate> {
MBProgressHUD *HUD;
} @end

RootViewController.m

#import "RootViewController.h"
//加入头文件
#import <unistd.h> @interface RootViewController () @end @implementation RootViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
} - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view. //转动3s后停止
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
HUD.delegate = self;
[HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
[self.navigationController.view addSubview:HUD]; }
//等待3s
- (void)myTask {
sleep(3);
}

最新文章

  1. Mysql联合,连接查询
  2. c++ 字符串流 sstream(常用于格式转换) 【转载】
  3. 20160308001 GridView的Sorting排序
  4. IRunningObjectTable接口
  5. CentOS 7.2 MySQL 5.7 主从配置
  6. SQL backup&amp;restore
  7. [jobdu]第一个只出现一次的字符
  8. android 68 单元测试
  9. Unity3D动态加载外部资源
  10. 关于如何解决谷歌Chrome浏览器空白页的问题
  11. 使用spring mvc返回JSON,chrome可以,firefox不行的问题定位
  12. 团队作业8----第二次项目冲刺(beta阶段)5.23
  13. 关于签名sign的坑
  14. 微服务框架之微软Service Fabric
  15. python面向对象三大特性之封装
  16. Format Conditions按条件显示表格记录
  17. C# 去除json字符串key引号
  18. mysql5.7启动slave报错 ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
  19. HDU 5707 Combine String(动态规划)
  20. linux的bash和shell关系

热门文章

  1. MySQL 5.6不删空用户的影响
  2. JS脚本实现CSDN免登陆免关闭广告插件自动展开“阅读更多”内容
  3. 基于alpine用dockerfile创建的ssh镜像
  4. Ruby:线程实现经典的生产者消费者问题
  5. 用SpringSecurity从零搭建pc项目-01
  6. Log4j最佳实践
  7. 一口一口吃掉Hexo(三)
  8. jenkins发送邮件失败“No emails were triggered”
  9. Vue + Element UI 实现权限管理系统 前端篇(六):更换皮肤主题
  10. Vue笔记:VS Code 常用快捷键