Here I use the navigation controller navigation controllers in the View library.
The reminder operation mainly uses the Alertview:clickbuttonatindex in the Uialertviewdelegate protocol: method implementation, the syntax form is as follows:
-(void) Alertview: ( Uialertview *) Alertview clickedbuttonatindex: (nsinteger) buttonindex;
(uialertview *) Alertview used to specify the buttons contained in the warning view(nsinteger) Buttonindex The index of the button used to specify the click
The core code is as follows:
TableViewController.h
#import <UIKit/UIKit.h> @interface Tableviewcontroller:uitableviewcontroller<uitableviewdatasource, uitabbardelegate,uialertviewdelegate>{ Nsmutablearray *a;} -(ibaction) AA: (ID) sender;-(ibaction) BB: (ID) sender; @end
TABLEVIEWCONTROLLER.M part of the code snippet
-(ibaction) AA: (ID) Sender {uialertview *a = [[Uialertview alloc]initwithtitle:@ "edit" message:@ "Please select Project" Delegate:self can celbuttontitle:@ "Canel" otherbuttontitles:@ "Add", @ "Delete", nil]; [a show];} -(void) Alertview: (Uialertview *) Alertview Clickedbuttonatindex: (nsinteger) buttonindex{nsstring *b = [AlertView butto Ntitleatindex:buttonindex]; if ([b isequaltostring:@ "Delete"]) {[Self setediting:yes]; } if ([B isequaltostring:@ "Add"]) {Uialertview *a1 = [[Uialertview alloc]initwithtitle:@ ' Add ' message:@ ' OK to add a contact? "Delegate:self cancelbuttontitle:@" OK "otherbuttontitles:nil]; [A1 show]; }}-(ibaction) BB: (ID) Sender {[self setediting:no];} -(void) TableView: (UITableView *) TableView Commiteditingstyle: (uitableviewcelleditingstyle) Editingstyle Forrowatindexpath: (Nsindexpath *) indexpath{if (Editingstyle = = Uitableviewcelleditingstyledelete) {[A removeOb JectAtIndex:indexPath.row]; [TableView Deleterowsatindexpaths:[nsarray ArraywithObject:indexpath] withrowanimation:uitableviewrowanimationautomatic]; }}
iOS Development Learning # Reminder Processing # (1) Response reminder View