-(void)tryRun

{

tryTimes++;

id obj = [ASODataManager getAppleAccount];

if (obj) {

__block FirstViewController* sf = self;

//有账号,可以开始获取数据

[[ASODataManager sharedManager] fetchASOTaskListWithCompletionHandler:^(NSArray *data) {

NSMutableArray* arr = [[NSMutableArray alloc] initWithCapacity:[data count]];

for (id obj in data) {

if ([[obj objectForKey:@"isFinished"] integerValue] == 0) {

[arr addObject:obj];

}

}

sf->task = [arr copy];

if ([sf->task count] <= 0) {

//                [[[UIAlertView alloc] initWithTitle:@"提示" message:@"当前无任务" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];

[[KengSDKToolsiToast makeText:@"当前无任务"] show];

}

[sf.MainTableView reloadData];

}];

}else{

//没有账号,连续三次

if (tryTimes <= 3) {

[NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(tryRun) userInfo:nil repeats:NO];

}

}

}

最新文章

  1. UIActivityViewController(转)
  2. SymPy库常用函数
  3. [Letcode] 1. Two Sum
  4. 升级web项目步骤
  5. opencl 在vs2015上遇见的问题
  6. hdu2896
  7. 在使用hibernate的getHibernateTemplate()时怎么让控制台输出封装好的SQL? 怎么用日志打印出来?
  8. BZOJ 1115: [POI2009]石子游戏Kam [阶梯NIM]
  9. 《阿里巴巴Android编码规范》阅读纪要(二)
  10. 转 Eclipse快捷键调试大全
  11. Linux ip配置
  12. [Abp 源码分析]四、模块配置
  13. Android 修改 Menu字体颜色
  14. gitlab+jenkins+tomcat CI/CD 部署
  15. python函数练习——个人信息修改
  16. php和js字符串的acsii码函数
  17. Javascript 对象的创建和属性的判定
  18. swagger报错No handler found for GET /swagger-ui.html
  19. MVC ---- EF4.0和EF5.0增删改查的写法区别及执行Sql的方法
  20. Git_标签管理

热门文章

  1. configure.ac中AC_CHECK_LIB的问题
  2. 前端学习blog
  3. HDU 2553 N皇后问题【棋盘型DFS】
  4. HDU 2537 8球胜负(模拟)
  5. c++ primer敲代码第二章
  6. luogu P1824 进击的奶牛
  7. Problem X: 零起点学算法22——华氏摄氏温度转换
  8. flask 开发环境搭建
  9. iOS数据库操作(使用FMDB)
  10. RxJava 1.x 理解-3