Hi!! Am new to this forum and also new to IPhone development. Following is the issue: I have two views named pickerviewcontroller and secondviewcontroller which has different xib files. I choose a picture through the UIImagePickerController interface from the Photo Library, I was trying to display the chosen image in the second view. code is here pickerController is my first view controller
pickerController.h file
#import <UIKit/UIKit.h>
#import "SecondViewController.h"
@interface pickerControllerViewController : UIViewController<UIActionSheetDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate> {
IBOutlet UIButton *selectpic;
UIImageView *imageView; } @property (nonatomic,retain) UIImageView *imageView; @property (nonatomic,retain) UIButton *selectpic; -(IBAction)getpic:(id)sender; //-(void)goNext: (UIImagePickerController *)picker; @end
pickerController.m fie
#import "pickerControllerViewController.h"
@implementation pickerControllerViewController
@synthesize imageView,selectpic;
-(IBAction)getpic:(id)sender
{
UIImagePickerController *picker = [[UIImagePickerController alloc]init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:picker animated:YES];
}
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
SecondViewController *secview = [[SecondViewController alloc]initWithNibName:nil bundle:nil];
[secview setImage:imageView];
}
SecondVIewController.h file
@interface SecondViewController :UIViewController{
IBOutlet UIImageView *imageView2;
}
-(void)setImage:(UIImage *)image;
@end
SecondVIewController.m file
@implementation SecondViewController
-(void)setImage:(UIImage *)image{
imageView2 = image;
}
It is not showing any error.Am not able to display the image in the secondview. please help, am struck here for the last 1 week and i could not find any solution for this...
Thanks for the help in Advance!!!!!!!!!