开发者

How to call a view upon pressing a button in another view?

How to cal开发者_如何学Cl a view upon pressing a button in another view?


Where you init your button:

[myButton addTarget:self action:@selector(clickedButton:) forControlEvents:UIControlEventTouchUpInside];

then in a seperate function:

-(void)clickedButton:(id)selector {
    // delete as appropriate
    [self.navigationController pushViewController:viewController animated:YES];
    // or
    [self.view addSubview:theView];
    // or
    [self presentModalViewController:viewController animated:YES];
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜