我目前正在制作一个视频应用,我想让用户可以选择设置录制视频的时间。我试图使用步进按钮实现这一点。目前我能够按如下方式静态设置此计时器:
- (IBAction)captureVideo:(id)sender {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
picker.videoMaximumDuration = 10.0f;
[self presentViewController:picker animated:YES completion:NULL];
}
}
如何使用步进器的值?或者有更好的方法吗?
感谢。