Помогите мне пожалуйста. Я пытался удалить ячейку в tableview. Я начинаю разработку iOS.Как удалить ячейку в виде таблицы
, пожалуйста, помогите мне.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
int num = [[self.fetchedResultsController sections] count];
return [[self.fetchedResultsController sections] count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
id sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
NSInteger numberOfRows = [sectionInfo numberOfObjects];
return numberOfRows;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
id cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
способ подключить класс tableviewcell в моей камере, иметь более подробную информацию.
- (void)configureCell:(id)cell atIndexPath:(NSIndexPath *)indexPath
{
BookDetail *bookDetail = [self.fetchedResultsController objectAtIndexPath:indexPath];
[(storageuser *)cell settingupWithInfo:bookDetail];
}