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

2018-06-08  本文已影响0人  ZebZheng
 //更新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();
上一篇 下一篇

猜你喜欢

热点阅读