开发者

pushViewController call from uiview

let me explain you my problem:

I have an UIViewController with 2 UIViews. I have a button in one of my UIView and i call a methode from my UIViewController.

    [controller actionMainSettings];

And this is the methode:

-(void)actionMainSettings{
     MainSettings *mainController = [[MainSettings alloc] initWithNibName:@"MainSettings" bundle:nil];
    [self.navigationController pushViewController:mainController animated:YES];
    [[self navigationController] setNavigationBarHidden:YES animated:NO];
    [mainController release];   
}

MainSettings is an UIVewController...

and nothing happen...

开发者_高级运维

When i put my button in my UIVIewController ([self.view addSubview:buttonSettings];) it's ok but i want to put it in another UIView.

Can someone explain me what happen?

thx


I am not very sure about this but you could try super.navigationController instead of self.
Also, from the look of your code, I would assume it's a settings view. I would recommend that you use [self presentModalView:yourView animated:YES]. You can look at the UIView documentation for a range of animations.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜