objective c - UIBarButtonItem disappears when replacing DetailViewController, reappears after rotating -
After reading several sources related to this, I can only conclude that I should set my representative at the wrong time , But I can replace the details view controller on the selection of a table row in the master like this:
AppDelegate * app = (app deliit *) [[UIPAPRC share application]]]]; CustomerDetailViewController * newvc = [[CustomerDetailViewController alloc] initWithNibName: @ "CustomerDetailViewController" bundle: Zero with customer: [custData objectForKey: @ "name"]]; [App.detailNavigationController setViewControllers: [NSArray arrayWithObjects: newvc, zero]]; This view controller sets in the CustomerDetailViewController, I assign to the delegate:
- (id) initWithNibName: (NSString *) nibNameOrNil bundle: (NSBundle *) nibBundleOrNil {self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]; If (self) {AppDelegate * app = (AppDelegate *) [[UIApplication shared applicant]]]; App.splitViewController.delegate = self; } Healthy return; } What happens if a strip is selected in the image bar, then I do not see barbitonism. However, if I rotate in the landscape and then come back to the portrait, barbutonium is visible.
I had thought of setting my representative in init, but this would not be obvious.
Can someone tell me where to assign to the delegate ??
I believe that I have found a solution - it seems like a duplicate of the question.
Comments
Post a Comment