目前我使用StoryBoard爲iPad開發。另外我添加一個ViewController.xib文件和一個視圖。現在我想把按鈕從xib返回到故事板。我的代碼在下面,但這不起作用。從xib到故事板的後退按鈕
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *initViewController = [storyBoard instantiateInitialViewController];
[self.navigationController pushViewController:initViewController animated:YES];
你如何展示這個視圖控制器?從故事板場景? – bl4stwave 2014-12-13 07:20:44
故事板到xib我正在使用下面的代碼。 UITableViewCell * selectedCell = [tableView cellForRowAtIndexPath:indexPath]; NSString * cellText = selectedCell.detailTextLabel.text; NSLog(@「item title:%@」,cellText); ViewController * vc = [[ViewController alloc] initWithNibName:@「ViewController」bundle:nil]; self.window.rootViewController = self.viewController; vc.strFullName = cellText; [self.view addSubview:vc.view]; – Saravanan 2014-12-13 07:34:10
我希望我的回答可以幫助您 – bl4stwave 2014-12-13 07:46:22