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:

  1. the alertview shown after (6/7) seconds
  2. 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

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -