When we go portrait mode while using a UISplitViewController, they will provide us by a barButtonItem. How can I use a customView for that barButtonItem?
I tried the following way. It works if I start with portrait orientation. But if I go landscape and when I come back it crashes.
In viewDidLoad
UIImage *image = [UIImage imageNamed:@"home.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.bounds = CGRectMake(0, 0, 22.00, 22.00);
[button setImage:image forState:UIControlStateNormal];
[button addTarget:self action:@selector(showHomeDetails) forControlEvents:UIControlEventTouchDown];
homeButton = [[UIBarButtonItem alloc] initWithCustomView:button];
[button release];
Then in willHideViewController
barButtonItem = homeButton;
What shud I do? OR is there an alternate solution?