-2

I'm working with tabBarBased Application. - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker

This method is called at the time of clicking the cancel button in iphone photo album..while clicking the cancel button i want to navigate to the another tabBar view...Please help me what should i give inside imagePickerControllerDidCancel method..

Thanks & Regards, Renuga

Varshu
  • 64
  • 10

2 Answers2

1

You can navigate to other view as usual by using navigationController push view controller if your tab having navigation controller. otherwise add other view on window. and for selecting any other tab view you can use setSelectedIndex for the tab.

If you have any problem in implementing the concept then let me know.

edit:

For selection of the tab

[appObj.tabBarController setSelectedIndex:2];

since tabBar is the part of appDelegate class so you need to make a object for AppDelegate class here.

by using

appObj=(yourApplicationAppDelegate *)[[UIApplication sharedApplication] delegate];
Ishu
  • 12,797
  • 5
  • 35
  • 51
  • ok...thank you ishu Gupta....it works fine for go to rootviewcontroller.if i want to go for subviewcontroller of tabBar view means what should i want to do??please give some ideas... – Varshu Dec 17 '10 at 09:27
  • You can direct navigate to that view or first setSelectedIndex then on viewDidLoad or viewWillAppear of that view you can check with if condition and in this navigate to that subView. – Ishu Dec 17 '10 at 09:32
  • Ok if it helps you then it need to upvote and if it solves your problem then acceptance is good for the answer. – Ishu Dec 17 '10 at 09:33
  • ok thank you...shall i ask my doubt again i'm having any troubles? – Varshu Dec 17 '10 at 09:36
  • ok but please upVote and acceptance of the answer must required. – Ishu Dec 17 '10 at 09:41
  • thank you renuga you can ask any other problem realated to this issue.i think you forget to give an upvote. – Ishu Dec 17 '10 at 09:47
  • upvote means what?i don't know...how to do voting??but i,already accepted your answer is a best for my question...please tell me how to vote??? – Varshu Dec 17 '10 at 10:21
  • Ok you can see above your tick mark 0 score has displayed with two arrow for upvote click on upper arrow and for down vote click on down arrow. – Ishu Dec 17 '10 at 10:24
  • -1 for down vote +2 for accept the answer.No change for upvote.But upvote is for encourage the people to provide their help. – Ishu Dec 17 '10 at 10:44
0

Read this: UITabBarController is possible to select the tab via code?

Community
  • 1
  • 1
Alexander Wallin
  • 1,394
  • 10
  • 22