我试图为UIImagePickerController类实现自己的委托
这是调用相机的方法
- (IBAction)acquisisciFoto:(id)sender{
ImagePickerDelegate *pickerDelegate = [[ImagePickerDelegate alloc] init];
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
[picker setDelegate:pickerDelegate];
[picker setAllowsEditing:NO];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:picker animated:YES];
}
ImagePickerDelegate.h
#import <Foundation/Foundation.h>
@interface ImagePickerDelegate : NSObject <UIImagePickerControllerDelegate,UINavigationControllerDelegate>
@end
ImagePickerDelegate.m
#import "ImagePickerDelegate.h"
@implementation ImagePickerDelegate
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSLog(@"%@", @"test");
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[picker.parentViewController dismissModalViewControllerAnimated: YES];
}
@end
但没有任何效果,我有这个错误:
sharedlibrary apply-load-rules all 警告:在加载的库中检测到UUID不匹配 - 在磁盘上是: / Developer / Xcode / iOS DeviceSupport / 5.0 9A334)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (gdb)
PS。与代表:自我工作好,但我需要在同一视图中使用2 btn,他们必须开启相机。
请帮帮我