controller.allowsEditing = NO;神医,

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

{

    if (buttonIndex != actionSheet.cancelButtonIndex) {

        UIImagePickerController* controller = [[UIImagePickerControlleralloc] init];

        controller.delegate = self;

        if (buttonIndex == 0) {

            if (![UIImagePickerControllerisSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {

                return;

            }

            controller.sourceType = UIImagePickerControllerSourceTypeCamera;

        }

        else {

            controller.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

        }

        controller.allowsEditing = NO;

        [SharedAppDelegate.window.rootViewControllerpresentModalViewController:controller animated:YES];

    }

 

}

枚举类型,没有初始化,默认会读取第一个的,

原文地址:https://www.cnblogs.com/guligei/p/3490395.html