zoukankan      html  css  js  c++  java
  • iOS8 iPad Warning: Attempt to present <UIImagePickerController:xxxx > on xxxx which is already presenting (null)

    解决方法:

    /*
         I think this is because in iOS 8, alert views and action sheets are actually presented view controllers
         (UIAlertController). So, if you're presenting a new view controller in response to an action from the UIAlertView, 
         it's being presented while the UIAlertController is being dismissed.I worked around this by delaying the 
         presentation of the UIImagePickerController until the next iteration of the runloop, by doing this:
    */
    __weak typeof(self) weakSelf = self;
    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [weakSelf presentViewController:imagePicker animated:YES completion:nil];
    }];

    However, the proper way to fix this is to use the new UIAlertController API on iOS 8 (i.e. use if ([UIAlertController class]) ... to test for it). This is just a workaround if you can't use the new API yet.

  • 相关阅读:
    STM32概述
    对xlslib库与libxls库的简易封装
    Makefile.am编写规则
    linux下使用autoconf制作Makefile
    python 登录三次禁止登录
    Linux -- gpasswd
    Linux -- userdel
    Linux -- groupmod
    Linux -- groupadd
    Linux -- passwd
  • 原文地址:https://www.cnblogs.com/Rinpe/p/5669903.html
Copyright © 2011-2022 走看看