Pages

Subscribe:
Showing posts with label getting image from album. Show all posts
Showing posts with label getting image from album. Show all posts

Tuesday, September 21, 2010

Choosing Image through Action Sheet

-(IBAction)choosePictureButtonPressed
{


UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:nil
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"From Album",@"Camera",nil];

actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
actionSheet.cancelButtonIndex=2;
[actionSheet showInView:self.view];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet release];
}

-(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{

if(buttonIndex==0)
{
[self libraryAction];//:YES];
}
else if(buttonIndex == 1)
{
[self camAction];//:YES];
}
}