首页 > 技术文章 > NSRunLoop

wb145230 2015-04-15 10:47 原文

NSInteger couter = 0;
while (self.aa == nil && couter < 10) {
     NSLog(@"aa为空,阻塞不去构造JSON字典");
     couter++;
   //每隔一秒检查一下aa是否为空,最多尝试10次. [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:
1]]; }

 

推荐阅读