i use splitview controller in my ipad application,it works ok,but sometimes when i change interface from landscape to potrait it disappear bar button and popovercontroller from the toolbar.
plz answer if anyone know about this problem.
i use splitview controller in my ipad application,it works ok,but sometimes when i change interface from landscape to potrait it disappear bar button and popovercontroller from the toolbar.
plz answer if anyone know about this problem.
This was a known issue with some of the iPad SDK betas. Was this project created with a beta? If so I would create a new split view project with the GM release and then copy your existing code into the new split view project.
I have exactly the same issue. Did anyone find a solution for this?
Thanks!
EDIT:
Found a solution. Just set the "animated" parameter to NO in the setItems method of the toolbar.
- (void)splitViewController: (UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc {
barButtonItem.title = @"Clients";
NSMutableArray *items = [[toolbar items] mutableCopy];
[items insertObject:barButtonItem atIndex:0];
[toolbar setItems:items animated:NO];
[items release];
self.popoverController = pc;
}
- (void)splitViewController: (UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {
NSMutableArray *items = [[toolbar items] mutableCopy];
[items removeObjectAtIndex:0];
[toolbar setItems:items animated:NO];
[items release];
self.popoverController = nil;
}