0

这是示例代码。

if(MyPageViewControllerObj==nil)
    {
        MyPageViewController *vController = [[MyPageViewController alloc] initWithNibName:@"MyPageView" bundle:[NSBundle mainBundle]];
        self.MyPageViewControllerObj=vController;
        [vController release];
        noOfWrongAnswers=0;
        noOfRightAnswers=0;
    }
    MyPageViewControllerObj.sessionid=sessionid;
    MyPageViewControllerObj.categoryID = categoryId;
    MyPageViewControllerObj.flashcardIdforcount = flashcardid;
    MyPageViewControllerObj.categoryType=categoryType;
    MyPageViewControllerObj.indexViewControllerobj=self;
    [self.navigationController pushViewController:MyPageViewControllerObj animated:YES];

我需要写这行****[MyPageViewControllerObj release]****

在将其推入导航控制器之后。也在 dealloc 方法中......

4

1 回答 1

3

是的,你应该释放你MyPageViewControllerObjUINavigationController保留它。它不需要在-dealloc方法中。

于 2009-07-28T10:31:56.113 回答