2011-08-23 54 views

回答

0

找到視圖控制器將在UISplitViewController主視圖和設置標題中viewDidLoad方法是這樣的:

self.title = @"Set Title"; 

由於主視圖將最終修改的細節視圖你可以將一個方法的詳細視圖控制器駁回UIPopoverController您選擇後一排。下面是一個例子。

在DetailViewController(詳情查看)

所以實現這樣

- (void)setDetailDescription:(NSString *)text { 

    // Put code to update the detail view here 

    [self.popoverController dismissPopoverAnimated:YES]; 

} 

,然後在RootViewController的(主視圖)的方法實現此代碼

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 

{

DetailViewController *dc = [self.splitViewController.viewControllers objectAtIndex:1]; 

[dc setDescription:@"Update detail view"]; 

}

注意到,您的設置會有所不同,所以你將不得不將此代碼適應你的項目。

3
在視圖控制器

self.navigationItem.title = @"The text you want"; 

,並「跳過」的酥料餅當選擇了行做的某個時候這樣

- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
     [self.navigationController dismissModalViewControllerAnimated:YES]; 

    } 
相關問題