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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -