ios - Flashing screen although I do my alerts on main thread -


i know uikit stuff should done on mian thread, that's why, ensure alert view showing on main thread.

-(void)showalert:(nsstring *)alertmessage{      uialertview *alert = [[uialertview alloc] initwithtitle:alertmessage message:nil delegate:nil cancelbuttontitle:nil otherbuttontitles:@"ok", nil];     dispatch_async(dispatch_get_main_queue(), ^{         [alert show];     });  } 

however, when dismiss alert, screen becomes flashing. didn't fix issue, missing something?

if calling show alert method form background thread, please try using

    [self performselectoronmainthread:@selector(showalert:) withobject:alertmessage waituntildone:yes]; 

for method call , change showalert method

uialertview *alert = [[uialertview alloc] initwithtitle:alertmessage message:nil delegate:nil cancelbuttontitle:nil otherbuttontitles:@"ok", nil];     [alert show]; 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -