-2

我有一个带有两个 ViewController 的应用程序。一个有一个 WebView,另一个有一个按钮。我希望当按下按钮时,在另一个 ViewController 中的 WebView 中携带一个页面。

4

1 回答 1

0

单击按钮时,

-(void)ButtontnCliked:(UIButton*)sender 
{
  //create object of class to which you want to navigate.

  NewView *viewController = [[NewView alloc]initWithNibName:@"NewView" bundle:nil]; //NewView is my new class
  [self.navigationController pushViewController:viewController animated:YES];  // it will pushes your current view to newView.
  [viewController release];
}

注意:假设您的 rootViewController 是导航控制器。

于 2012-08-17T12:05:12.700 回答