如何在appdelegate方法中删除视图?

时间:2013-02-20 11:49:07

标签: iphone ios facebook view appdelegate

我想在appdelegate.m中移除一个viewcontroller的视图,在此方法中 - (void)GetUserCompleted我想删除一个视图。请帮助我

下面是FB委托方法,在dis方法中我想删除包含loginwithFB按钮的视图,

appdelegate.m

- (void) GetUserCompleted
{
    NSLog(@"  %@",fbUserName);
    NSLog(@"  %@",fbmailId);
    NSLog(@"  %@",fblocation);
    NSLog(@"  %@",fbhomeTown);
    NSLog(@"   %@",fbgender);
}

1 个答案:

答案 0 :(得分:0)

你应该使用类似的东西:

    NSMutableArray *allViewControllers = [NSMutableArray arrayWithArray: self.navigationController.viewControllers];
    for (id object in allViewControllers) {
        if ([object isKindOfClass:[FacebookClassNameToremove class]]) {
            [allViewControllers removeObject:object];
        }
    }
    self.navigationController.viewControllers = allViewControllers;