0

我在标题中声明了这一点:

#import <UIKit/UIKit.h>

@interface NFNoteCamera : UIImagePickerController

@end

并接收 27 个语义问题,例如

属性“cameraCaptureMode”需要定义方法“cameraCaptureMode” - 使用@synthesize、@dynamic 或在此类实现中提供方法实现

包括“allowsImageEditing”、“allowsEditing”和其他相机特色问题。如果我不得不猜测这是我还没有导入的东西。有任何想法吗?

4

1 回答 1

1

正如医生所说

重要UIImagePickerController 类仅支持纵向模式。此类旨在按原样使用,不支持子类化。此类的视图层次结构是私有的,不得修改,但有一个例外。在 iOS 3.1 及更高版本中,您可以将自定义视图分配给 cameraOverlayView 属性,并使用该视图来呈现附加信息或管理相机界面和代码之间的交互

你为什么不直接实现它的委托?

@interface NFNoteCamera : ParentClass <UIImagePickerControllerDelegate>
{
   UIImagePickerController *yourPicker;  
}
@end

@implementation NFNoteCamera
-(void)anyMethod{
yourPicker = [[UIImagePickerController alloc] init];
yourPicker.delegate = self;
[yourPicker setAllowsEditing:BOOL];
              //or photo library(UIImagePickerControllerSourceTypePhotoLibrary)
yourPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:yourPicker animated:YES];
}
//delegate methods
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
       UIImage *producedImage = [info objectForKey:UIImagePickerControllerOriginalImage];
}
@end
于 2012-07-08T04:29:13.067 回答