我正在開發一個應用程序,它同時使用視頻錄製和照片shoting.So我想顯示按鈕爲此操作系統我執行這些methods.It工作正常,當我爲OS 3.1,但是當我建立OS 3.0也顯示錯誤imagepicker控制器爲iPhone模擬器3.0生成時顯示錯誤
這裏有方法
if ([self videoRecordingAvailable])
{
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.allowsImageEditing = YES;
imagePickerController.allowsEditing = YES;
imagePickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
imagePickerController.videoMaximumDuration = 60.0f; // Length for video recording in seconds
imagePickerController.mediaTypes = [NSArray arrayWithObjects:@"public.movie", nil];
imagePickerController.showsCameraControls=YES;
[self.navigationController presentModalViewController:imagePickerController animated:YES];
}
- (BOOL) videoRecordingAvailable
{
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) return NO;
return [[UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera] containsObject:@"public.movie"];
}
錯誤是
error: request for member 'allowsEditing' in something not a structure or union
error: request for member 'videoQuality' in something not a structure or union
error: 'UIImagePickerControllerQualityTypeHigh' undeclared (first use in this function)
(Each undeclared identifier is reported only once for each function it appears in.)
error: request for member 'videoMaximumDuration' in something not a structure or union
error: request for member 'showsCameraControls' in something not a structure or union
我如何解決日是問題?
你能完成代碼嗎?我的意思是根據你的要求改變我的代碼.... – 2010-01-16 08:55:44
不,因爲我真的認爲現在你最好自己弄明白。至少在你再次遇到真正的問題之前。 – zoul 2010-01-16 08:58:35
但它不工作。在這裏我試了 [imagePickerController setAllowsImageEditing:YES]; \t \t \t SEL msg = @selector(setVideoQuality :); \t \t \t如果([imagePickerController respondsToSelector:MSG]) \t \t \t \t [imagePickerController performSelector:MSG withObject:自afterDelay:0]; 但它仍然顯示錯誤 – 2010-01-16 09:08:45