簡體   English   中英

推視圖控制器的正確方法

[英]Proper way to push a view controller

我有一個UIViewController希望推送到堆棧上,但是,當我在推送它后調用[viewController release]時,無論何時將其從堆棧中彈出,都會遇到與釋放實例有關的各種錯誤。視圖控制器。 這是一個實現示例:

        RootViewController *rootViewcontroller = [[RootViewController alloc] initWithNibName:@"RootViewController" 
                                                                                          bundle:nil];
        [self.navigationController pushViewController:rootViewController animated:YES];
        [rootViewController release];

在顯示的代碼中,您創建了rootViewController但實際上推送了personsViewController 錯別字? 還是您粘貼了錯誤的代碼?

您的RootViewController實例為“ rootViewcontroller”,但您要推送“ rootViewController”(注意'C'?)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM