我用的UITableView在UIViewController..I工作使用下面的委託方法我.....調用UITable查看委託方法
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
一旦我加載視圖我發現所有代表被調用。 ....但我需要調用這些方法中的一個按鈕,點擊.....
我這樣試過....
[self tableView:table numberOfRowsInSection:rows];
[self tableView:table cellForRowAtIndexPath:path];
我發現,這些方法被調用,但什麼也沒發生(這些代表內部的代碼不起作用)....我不知道爲什麼?有什麼建議麼???
你不應該直接調用這些委託方法,而是實現它們,以便表視圖可以調用它們來詢問它需要顯示的信息。請定義什麼「不起作用」 - 你看到你期望看到什麼? – jrturton