1
我MasterViewController.h如下:UITableView的相關方法沒有運行
@interface XYZMasterViewController : UITableViewController <NSFetchedResultsControllerDelegate, UIAlertViewDelegate> {
NSMutableArray *array; //unimportant
NSUInteger buttonIndex; //unimportant
BOOL waitForAction; //unimportant
NSString *titleEntered;//unimportant
NSString *duedateEntered; //unimportant
}
,並在我的(.M)文件我聲明的方法:
- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)actionforRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
{
NSLog(@"canPerformAction Method entered");
[self switchTitle:tableView indexPath:indexPath];
return YES;
}
,但它不是在所有運行, NSLog從不打印出來。這就像它被忽略,只是繼續與應用程序的其餘部分。
謝謝4任何幫助!
您需要將表視圖上的委託設置爲指向控制器實例。 – 2012-01-27 13:43:04