在视图上触发一个动作表确实在ios 6中加载了但现在它在ios 7上崩溃了。将它移动到viewWillAppear没有帮助。在视图显示后从按钮单击触发操作表可以正常工作。为什么它现在不适用于ios 7?
现在加载视图时,建议自动触发操作表的方法是什么?
UIActionSheet *actionSheet;
NSString* title = @"update your public profile picture";
if (![UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {
actionSheet = [[UIActionSheet alloc] initWithTitle:title delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles: @"Choose Existing Photo", nil];
}
else {
actionSheet = [[UIActionSheet alloc] initWithTitle:title delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Take Photo", @"Choose Existing Photo", nil];
}
[actionSheet showFromRect:CGRectMake(0, 0, [[UIScreen mainScreen]bounds].size.width, [[UIScreen mainScreen]bounds].size.height) inView:self.view animated:YES];