-1
如何調用默認的insertNewObject方法?我在故事板創建自定義按鈕,並將其鏈接到名爲ADDDATE的行動,但我不太明白insertNewObject需要什麼參數如何在IOS中調用默認的insertNewObject方法
- (void)insertNewObject:(id)sender
{
if (!_objects) {
_objects = [[NSMutableArray alloc] init];
}
[_objects insertObject:[NSDate date] atIndex:0];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}
- (IBAction)addDate:(id)sender {
// have to call insertNewObject
}
http://www.informit.com/articles/article.aspx?p=2148655&seqNum=7的[我怎麼能調用的方法 –
可能重複目標C?](http://stackoverflow.com/questions/591969/how-can-i-call-a-method-in-objective-c) – Brandon