從當(dāng)前控制器切換控制器-筆記

- (void)requestProductDetails
{
    NSString *urlStr = [NSString stringWithFormat:@"%@mobile/product/new/%@.json", YJJUrlHttpHost, self.productId];
    [SVProgressHUD show];
    [[YJJNetwork shareNetWork] GET:urlStr
                      parameterDic:nil
                        completion:^(YJJResponse *response) {
                            if (response.status == YJJResponseStatusSuccess)
                            {
                                [SVProgressHUD dismiss];
                                id permissionValue = response.data[@"hasPermission"];
                                if (permissionValue && [NSString stringWithFormat:@"%@", permissionValue].integerValue == 0) {
                                    YJJProductNoPermissionViewController *vc = [[YJJProductNoPermissionViewController alloc] init];
                                    vc.hidesBottomBarWhenPushed = YES;
                                    NSMutableArray *viewControllers = [[NSMutableArray alloc] initWithArray:self.navigationController.viewControllers];
                                    [viewControllers replaceObjectAtIndex:viewControllers.count - 1 withObject:vc];
                                    [self.navigationController setViewControllers:viewControllers animated:NO];
                                    return;
                                }
                                
                                self.stockProduct = [[YJJStockProduct alloc] initWithDictionary:response.data];

                                [self initialzation];
                                [self updateMainViews];
                                [self voucherButtonClick:self.stockProduct.brand.brandId];
                            }
                            else
                            {
                                [SVProgressHUD showErrorWithStatus:response.errorMsg];
                            }
                        }];
}

摘要

if (permissionValue && [NSString stringWithFormat:@"%@", permissionValue].integerValue == 0) {
                                    YJJProductNoPermissionViewController *vc = [[YJJProductNoPermissionViewController alloc] init];
                                    vc.hidesBottomBarWhenPushed = YES;
                                    NSMutableArray *viewControllers = [[NSMutableArray alloc] initWithArray:self.navigationController.viewControllers];
                                    [viewControllers replaceObjectAtIndex:viewControllers.count - 1 withObject:vc];
                                    [self.navigationController setViewControllers:viewControllers animated:NO];
                                    return;
                                }
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 微信: 導(dǎo)航控制器控制的界面A通過按鈕點(diǎn)擊跳轉(zhuǎn)到掃碼界面B, 掃到二維碼跳到界面C, 界面C popViewCon...
    繚霧閱讀 1,049評(píng)論 0 1
  • 在.h中聲明 - (UIViewController *)viewController 在view的.m中實(shí)現(xiàn) -...
    冬日無恙閱讀 205評(píng)論 0 2
  • 從去年十一月份就開始在自己的公眾號(hào)里寫點(diǎn)東西,為了提高,也經(jīng)常瀏覽和學(xué)習(xí)別人的文章,后來看到一些作者是簡書簽約作家...
    笑笑竹筍妹閱讀 361評(píng)論 2 0
  • “你在哪兒?”老岳興沖沖地問,“我?我在家啊,我今天好累?!毙⌒U懶懶地答著。“這段時(shí)間好嗎,我今天有時(shí)間,等下去看...
    我是白小姐閱讀 631評(píng)論 0 0

友情鏈接更多精彩內(nèi)容