在view里怎么push到某个页面

2022-05-14  本文已影响0人  这个姑凉儿
    HomeZhuTiViewController *vc = [[HomeZhuTiViewController alloc]init];
    [[self viewContainingController].navigationController pushViewController:vc animated:YES];
-(UIViewController*)viewContainingController
{
    UIResponder *nextResponder =  self;
    
    do
    {
        nextResponder = [nextResponder nextResponder];

        if ([nextResponder isKindOfClass:[UIViewController class]])
            return (UIViewController*)nextResponder;

    } while (nextResponder);

    return nil;
}
上一篇下一篇

猜你喜欢

热点阅读