objective c - How to pop up UIAlertView when the numberofrow (TableView) is 1 -
objective c - How to pop up UIAlertView when the numberofrow (TableView) is 1 -
i have 'add' button create new row of tableview. , number of row limited one.
- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { // homecoming number of rows in section. homecoming 1; }
i'd button pop alert view when there 1 row, not allowing create new row.
however don't know how implement 'if condition' in button action following:
- (ibaction)add { if (condition) { uialertview *alert = [[uialertview alloc] initwithtitle:@"title" message:@"hi" delegate:self cancelbuttontitle:@"done" otherbuttontitles:nil]; } [alert show]; }
please help! sorry not beingness professional, i'm trying larn objective c
all have -
- (ibaction)add { if ([self.tableview numberofrowsinsection:0] == 1) { uialertview *alert = [[uialertview alloc] initwithtitle:@"title" message:@"hi" delegate:self cancelbuttontitle:@"done" otherbuttontitles:nil]; } [alert show]; }
objective-c uialertview
Comments
Post a Comment