Could you tell me how switching tab views work? Because in my "sendPressed" and "cancelPressed" methods I'm trying to switch from the second tab view to the first tab view. However as of right now I'm getting an error on the "[[array objectAtIndex:2] setSelectedSegmentIndex:1]" line.
#import "SecondViewController.h"
@implementation SecondViewController
- (IBAction) sendPressed:(UIButton *)sender
{
array = [[self tabBarController] viewControllers];
[[array objectAtIndex:2] setSelectedSegmentIndex:1];
[[self tabBarController] setViewControllers:array];
}
- (IBAction) cancelPressed:(UIButton *)sender
{
array = [[self tabBarController] viewControllers];
[[array objectAtIndex:2] setSelectedSegmentIndex:1];
[[self tabBarController] setViewControllers:array];
}
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
image = [info objectForKey:UIImagePickerControllerOriginalImage];
imageView.image = image;
[self dismissModalViewControllerAnimated:YES];
}
...
@end