0

I want to go to iphone photo album at the time of clicking the tabBarItem(that is at the time of particular view loading)..For this what should i do...I have no idea about this..please anyone help me out to do this...

Thank You in Advance

Varshu
  • 64
  • 10

1 Answers1

1

Try folloing code in ur application and assing action that button......

-(IBAction) pickImage
{

    ipc = [[UIImagePickerController alloc] init];
    ipc.delegate = self;

    if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
    }
    else {
        ipc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    }

    [self presentModalViewController:ipc animated:YES];

}

if u dine than vote me

AJPatel
  • 2,291
  • 23
  • 42
  • hi...AJPatel...at the time clicking tabbaritem viewDidLoad() method is called...where i want to giv this code... – Varshu Dec 15 '10 at 10:50
  • Hai...The above code shows an error.I'm adding the UIImagePickerControllerDelegates like this in my .h file(@interface My_Pictures : UIViewController ) .But i'm not import anything in my .m file...should i want to include any of the Frameworks??please give me a clear explanation....Please reply me as soon as possible...i'm waiting for the reply....Thank u for your effort in advance... – Varshu Dec 16 '10 at 05:15
  • this code work proper in my app.. U call proper delegate u not require any other including file here..... u make other syntax error... in app – AJPatel Dec 16 '10 at 12:18