美文网首页
代码块内容执行完毕再走下一步方法

代码块内容执行完毕再走下一步方法

作者: ZebZheng | 来源:发表于2018-06-08 16:24 被阅读0次
 //更新token(同步更新)
        CommonViewModel *vm=[CommonViewModel new];
        [vm refreshLoginSuccess:^(BaseResponseData *result) {
            [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_LOGINCHANGE object:@YES];
             //这里改变RunLoop模式
            CFRunLoopStop(CFRunLoopGetMain());
        } failure:^(BaseResponseData *result) {
            NSDictionary *userInfo=@{@"isPresentLoginVC":@(0)};
            [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_LOGINCHANGE object:@NO userInfo:userInfo];
            //这里改变RunLoop模式
            CFRunLoopStop(CFRunLoopGetMain());
        }];
        //这里恢复RunLoop
        CFRunLoopRun();

相关文章

网友评论

      本文标题:代码块内容执行完毕再走下一步方法

      本文链接:https://www.haomeiwen.com/subject/bbuasftx.html