When I add a new row, it currently adds a new row with the current date as the title. Below is the code that I have. What do I change "NSDate date" to so that the user can input whatever title they want?
(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:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}
You could use the new
UIAlertView
with plain text entry. You'll also have to change your table view cell to display anNSString
instead of anNSDate
. (Oh, and you have to adopt theUIAlertViewDelegate
in the class.