对于UIImagePickerControllerSourceTypePhotoLibrary,'CameraTakePictureOverlay'没有可见的@interface

时间:2016-07-22 21:42:39

标签: objective-c uibutton uiimagepickercontroller overlay photolibrary

在我这里使用访问UIImagePickerControllerSourceTypePhotoLibrary按钮覆盖时遇到问题,问题在于选择器(takeLib :)。

使用imagePicker的属性

@property (weak, nonatomic) UIImagePickerController *imagePicker;

- (UIButton *) createGetLibraryButton {

UIImage *imglibraryPicture = [StyleKit imageOfLibraryIcon];



CGRect bounds = [UIScreen mainScreen].bounds;

CGRect takePicRect = CGRectMake((bounds.size.width/2) - (imglibraryPicture.size.width/1),
                                bounds.size.height-imglibraryPicture.size.height/2-CAMERA_BOTTOM_BUTTON_PADDING,
                                imglibraryPicture.size.width/2,
                                imglibraryPicture.size.height/2);

UIButton *btnLibrary = [[UIButton alloc] initWithFrame:takePicRect];

//using  selector(takeLib:)
[btnLibrary setBackgroundImage:imglibraryPicture forState:UIControlStateNormal];
[btnLibrary addTarget:self action:@selector (takeLib:) forControlEvents:UIControlEventTouchUpInside];

return btnLibrary;
}

此处的选择器是问题发生的地方

-(void) takeLib:(id)sender
{
self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.imagePicker.delegate = self;
[self presentViewController:self.imagePicker animated:YES completion:^{
  }];
}

错误说明:  No visible @interface for 'CameraTakePictureOverlay' declares the selector 'presentViewController:animated:completion:'

1 个答案:

答案 0 :(得分:0)

你从超级班继承了javersBuilder.registerValueObject(Person.class) ? 超级班应为CameraTakePictureOverlayUIImagePickerController个文档

  

显示用户界面。在iPhone或iPod touch上,通过调用当前活动视图控制器的presentViewController:animated:completion:方法,以模态方式(全屏)执行此操作,将配置的图像选取控制器作为新视图控制器传递。