ios8以后,UIActionSheet选择相册兼容问题

在iOS8之前,UIActionSheet用的代理方法为

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex

在iOS8之后这种代理方法无法调用相册相机等,并且警告--Warning: Attempt to present <UIImagePickerController: 0x15d933a00>  on 。。。,原因在警告里说得比较明白了,因为已经有actionsheet存在了,不能present新的。此时我们选择新的委托方法

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex

 

posted @ 2016-08-03 10:02  YuFly  阅读(134)  评论(0)    收藏  举报