2010-08-22 120 views
0

我正在爲我的客戶開發應用程序。我現在卡住了。如何創建自定義的uviewview?

我不知道該如何解釋。但我做了一個Photoshop的圖像。

http://i.stack.imgur.com/cV4mL.jpg

上父的TableCell
  1. 用戶抽頭。
  2. execute didSelectRowAtIndexPath:(NSIndexPath *)indexPath。用戶選擇單元格。親本細胞更新。

任何人都知道這是什麼叫? 你有教程嗎?

回答

0

使用UINavigationController和UITableViewController作爲它的根控制器,當深度更深的時候,爲它實例化一個不同的UITableViewController並將它推到導航棧上。彈出類似。

從Apple的文檔中可以找到很好的UINavigationController示例。

+0

hello eiko, 你知道嗎如何更新數據?從3到1? – neotorama 2010-08-27 17:38:05

1
// FirstViewController (1st in your Photoshop-design) 

... 

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
    SecondViewController *secondViewController = [[SecondViewController alloc] init]; 
    secondViewController.cell = [tableView cellForRowAtIndexPath:indexPath]; 
    [self.navigationController pushViewController:secondViewController animated:YES]; 
} 

... 

------------------------- 

// SecondViewController.h 

@interface SecondViewController : UITableViewController { 
    UITableViewCell *cell; 
} 

@property (nonatomic, retain) UITableViewCell *cell; 

------------------------- 

// SecondViewController.m 

... 

@synthesize cell; 

... 

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
    self.cell.detailTextLabel.text = @"Something"; 
    [self.navigationController popViewControllerAnimated:YES]; 
} 

... 
+0

你好tim, 你知道如何更新數據嗎?從3到1? – neotorama 2010-08-27 17:37:48