Iphone 如何在UIImagePickerController-didFinishPickingMediaWithInfo中获取发件人按钮标签/名称/ID?
有谁能指导我如何在下面的方法中获取Iphone 如何在UIImagePickerController-didFinishPickingMediaWithInfo中获取发件人按钮标签/名称/ID?,iphone,objective-c,xcode,Iphone,Objective C,Xcode,有谁能指导我如何在下面的方法中获取发送者按钮标签/Name/ID -(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info { // I Want to get the sender button reference here } 可以使用picker.view.tag标识UIImagePickerController类型。无
发送者按钮标签/Name/ID
-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
{
// I Want to get the sender button reference here
}
可以使用picker.view.tag标识UIImagePickerController类型。无论何时调用UIImagePicker,都可以设置其视图的标记 我用同样的方法来识别不同的图像选择器 编辑
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.allowsEditing = YES;
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.view.tag = 5;//set the tag here
无论何时设置,您都会得到标签值。试试这个
-(IBAction)ownMethod:(id)sender
{
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.allowsEditing = YES;
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
**imagePickerController.view.tag = [sender tag];//set the tag of button to picker tag **
[self presentViewController:imagePickerController animated:YES completion:nil];
}
我尝试了这个选项,但我得到的picker.view.tag值为(null)。我们需要在图像选择器按钮级别声明一些东西吗?
-(IBAction)ownMethod:(id)sender
{
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.allowsEditing = YES;
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
**imagePickerController.view.tag = [sender tag];//set the tag of button to picker tag **
[self presentViewController:imagePickerController animated:YES completion:nil];
}