![](/img/trans.png)
[英]Why can't I get this SQLite code to load the proper data for my detail view?
[英]Can't get my detail view to show
我有一個帶有四個選項卡的選項卡式主窗口,其中一個是列表。 該列表最初是空的,但是當我單擊“ +”時,會顯示可用選項的模態視圖,如下所示
- (IBAction)addThing:(id)sender {
MJAvailableThingsViewController *controller = [self availableThingsViewController];
[self presentModalViewController:availableThingsViewController animated:YES];
[controller setEditing:YES animated:NO];
}
這可行。
事物列表的每一行上都有一個UITableViewCellAccessoryDetailDisclosureButton。 這是通過annexTypeForRowWithIndexPath完成的。 這也可以。
當我在該視圖中單擊藍色的小按鈕時,將調用委托annexButtonTappedForRowWithIndexPath。 這可行。
但是,在abstractButtonTappedForRowWithIndexPath中,我想呈現事物的詳細視圖,這是我遇到問題的地方:
委托看起來像這樣:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath;
{
NSLog(@"accessoryButtonTappedForRowWithIndexPath");
NSLog(@"Tapped row %d", [indexPath row]);
[[self navigationController] pushViewController:thingDetailViewController animated:YES];
程序輸入此代碼,但沒有任何反應,即我得到了NSLog輸出,但沒有新窗口。 我對此很陌生,所以如果這很明顯,請原諒。 對我來說,不是... :-)
你有一個navigationController
嗎? 聽起來您有一個TabController
但沒有NavigationController
。
檢查[self navigationController]
,是否將其設置為任何值?
這是一個類似的問題:
帶導航控制器的標簽欄應用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.