1

I'm working with tabBarBased application.At the time of clicking the one of the tabBarButton it opens the photo album .In photo album there is a cancel button on top(navBar) right??Here i want to perform action event for cancel button click...while click on the cancel button i want to go to the another tabBar view...

Please help me out to do this...

Thank You in advance for your consideration and effort... Regards, Renuga

Varshu
  • 64
  • 10

2 Answers2

4

Here's the class definition for UIImagePickerControllerDelegate:

@protocol UIImagePickerControllerDelegate<NSObject>
@optional
// The picker does not dismiss itself; the client dismisses it in these callbacks.
// The delegate will receive one or the other, but not both, depending whether the user
// confirms or cancels.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_3_0);
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info;
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker;

@end

I think one of the methods mentioned above is what you need:

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker;
Di Wu
  • 6,436
  • 3
  • 35
  • 51
  • Exactly i want this method.- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker; At the time of clicking the cancel button in photo album imagePickerControllerDidCancel method is called..inside this method i have given this 2 lines of code to navigate to another view(picture)...Pictures *picturesController = [[Pictures alloc] initWithNibName:@"Pictures" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:picturesController animated:YES]; Here control goes to picture viewWillAppear method but it wont display anything.. – Varshu Dec 17 '10 at 06:44
  • but,picture viewWillAppear method having 3 buttons....please help me what should i give inside imagePickerControllerDidCancel... Thanks in advance... – Varshu Dec 17 '10 at 06:45
  • please give me some ideas...what should i give inside the imagePickerControllerDidCancel method to go to the another tabBar view... – Varshu Dec 17 '10 at 06:55
  • @Renuga: I am not able to tell what is actually wrong with your codes. But as a good practice I would suggest that you only use the *DidCancel* method as a way to inform your picker's delegate that your picker was just cancelled. As for those initializing and pushing stuff, you should left them to the delegate's methods, not your picker's. – Di Wu Dec 17 '10 at 15:39
0

set the selectedViewController property of UITabBarController to the view controller you want to switch to. Assigning a new view controller to this property changes the currently displayed view and also selects the appropriate tab in the tab bar.

jamihash
  • 1,900
  • 1
  • 12
  • 15