2011-06-15 86 views
0

我有一個BaseController和三個子類ViewControllers。在每個子類ViewControllers中,查詢sqlite數據庫以獲取信息。我想在BaseController級別添加一個longPress特性來彈出一個UIPopoverController。UIPopoverController層次結構/繼承與其他ViewControllers

因此,然後我有一個UITableViewController的子類與UIPopoverController一起使用來顯示數據。我是否需要從UITableViewController的子類中的sqlite數據庫獲取信息,以便將這些信息顯示在UIPopoverController中?這似乎是多餘的,因爲我的BaseController的3個子類已經有了數據,現在我只想在UIPopoverController中擁有這些數據,並且添加了其他功能,例如從UIPopovercontroller中選擇行時。

回答

0

UIPopoverController是一個視圖控制器。 SO: 顯示UIPopoverController中的table.view。

至於添加功能的連續壓機:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
// in here write what happens. if its row specific write: 
    /// if (indexPath.row == ROWNUMBER){method} (rows start at 0) 
} 

而這一切在你提出

了的tableView的.m文件去