ios - UIAlertView delay or not showing -
i have used uialertview several times without problems time can't make work correctly. (simple) code following:
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { alert = [[uialertview alloc]initwithtitle:@"" message:[nsstring stringwithformat: @"reload data ?"] delegate:self cancelbuttontitle:@"yes" otherbuttontitles:@"cancel", nil]; [alert show]; nslog(@"executed"); }
if touch in row of tableview have 2 different behaviours:
- the alertview shown after (6/7) seconds
- the alertview not shown. in case, touch in point of screen alert shown immediately.
in both cases, [alert show] executed after first touch because see "executed" in log screen. before , after alert, application not doing else.
any ?
try this
[[nsoperationqueue mainqueue] addoperationwithblock:^{ alert = [[uialertview alloc]initwithtitle:@"" message:[nsstring stringwithformat: @"reload data ?"] delegate:self cancelbuttontitle:@"yes" otherbuttontitles:@"cancel", nil]; [alert show]; nslog(@"executed"); }];
Comments
Post a Comment