在自定义的tabbarController控制器如下方法中注册一个通知
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moreMore) name:@"moreMore" object:nil];
}
然后实现该方法:
-(void)moreMore
{
for (UIView *tabBarButton in self.tabBarController.tabBar.subviews) {
if ([tabBarButton isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
[tabBarButton removeFromSuperview];
}
}
}
-(void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"moreMore" object:nil];
}
===
第二步:在需要使用popRootController的时候调用popRootController方法,并发一个上述的消息即可。
- (void)viewDidLoad {
}
然后实现该方法:
-(void)moreMore
{
}
-(void)dealloc
{
}
===
第二步:在需要使用popRootController的时候调用popRootController方法,并发一个上述的消息即可。