0
我已將轉換爲正在寫入ios 5的應用程序,然後使用內置工具將其轉換爲使用自動引用計數。 ios 5沒有問題,但在ARC轉換後,我的大部分委託調用似乎都不起作用。比如我的UITableViewController與.h文件,看起來像子類:轉換爲使用自動引用計數後不再調用委託方法
@interface UITableVCSubclass : UITableViewController <UITableViewDelegate, ... >
...
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
...
@end
表視圖的委託方法的tableView:didSelectRowAtIndexPath方法:不再當我選擇的表的行被調用。如果檢查self.tableview.delegate == self,它會。任何想法爲什麼這停止工作?
你能提供你的實現(如果有的話):** - (NSIndexPath *) tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath; ** –
最初沒有willSelectRowAtIndexPath:方法。我添加了以下內容,看看它是否會被調用: ' - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@「willSelectRowAtIndexPath called」); return nil; }' 。 。 。它沒有被調用。 – Alec
** tableView.delegate => self **連接是以編程方式或在Interface Builder中定義的? –