开发者

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

开发者 https://www.devze.com 2023-01-23 18:15 出处:网络
How to cal开发者_如何学Cl a view upon pressing a button in another view?Where you init your button:

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

精彩评论

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