UIAlertController showing with delay

后端 未结 2 1355
梦谈多话
梦谈多话 2021-02-01 13:44

I\'m experiencing a problem with UIAlertController on my app now migrated to iOS8 with Date Picker inside.

Below is the code.

UIAlertController *AlertVie         


        
2条回答
  •  猫巷女王i
    2021-02-01 14:07

    I was having the same issue with a UIAlertController presented by selecting a row from a UITableView. The first time everything worked fine, and then when the user triggered the alert again there was a few seconds delay before the alert was actually presented.

    As a workaround I used GCD:

        dispatch_async(dispatch_get_main_queue(), ^{
            [self presentViewController:AlertView animated:YES completion:nil];
        });
    

    It is probably a bug since -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath is already executed on the main thread.

    I submitted a bug report to Apple: rdar://19285091

提交回复
热议问题