ios - Remove all localnotifications and Cell in tableview -


I'm looking for a way to delete all the local notifications in my table view, with . I canceled all notifications and [code> [array removeAllObject]; , but he has not been able to work.

The importance to know is that there are two lines of local notifications in every section, as shown below.

CellForrightTaxpath:

  UITTEWUSECEL cell = [TableView DQURUbelCalView Identifier: cell identifier]; If (cell == blue) {cell = [[UITABLE DOCKEY alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: CellIdentifier]; } // Configure cell ... int rowIndex = (indexPath.section * 2) + indexPath.row; // Get a list of local notifications NSArray * Local Notifications = [[UIApplication shared application] Schedule notifications]; UILLocal Notification * Localization = [Local Notification Object and Line: Index Index]; // Display Notification Info [cell.textLabel setText: [Local Information. Alert action description]]; Cell.textLabel.font = [UIFont systemFontOfSize: 14.0]; Return cell;  

canEiditRowAtIndexPath

  return yes; [Self.tableViewReloadData];  

commitEditingStyle:

  if (edit type == UITableViewCellEditingStyleDelete) {// data source int rowIndex = (indexPath. Section * 2); // Receive 2 pieces of section NSArray * Local Notifications = [[UIApplication shared application] Schedule notifications]; UILocalNotification * Notify = [Local Notification Object Index: Line Index]; [[UIApplication shared application] CancelLocognition: notify]; Notify = [Local Notification ObjectAttandx: Line Index + 1]; [[UIApplication shared application] CancelLocognition: notify]; [Delete tableview: [NSIndexSet indexSet with index: indexpath. Section] Row Animation: UITableViewRowAnimationFade]; }  

Anyone know how to do this.

Did you reload the table view after removing all objects from the data source array?

You should do this in the action of your button

  - Clear (Zero) AllButtonTapped: (UIButton *) Clear AllButton {[UIApplication ShareApp] Cancel All Local Notifications ]; [The data removed deleted object]; [TheTableViewReloadData]; }  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -