- (void)showAlertView:(NSString *)message{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:message delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
如果提示说:
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release.
那么使用的时候就切换到单一主线程里:
dispatch_async(dispatch_get_main_queue(), ^{
[self showAlertView:@"登录失败"];
});