I have a view controller that loads from a xib. I am doing NOTHING with the size in code - it was all set up in the XIB file. I have logging set showing that iniwithnibname has correct width and height, viewdidload has correct width/height, viewwillappear has wrong width/height.
The width/height are changing to values that do not exist in my code.
This is an iPad landscape only app, and running it in simulator on 7.1 shows it broken, and 8.2 shows it OK.
Can anyone shed some light on this?
here is how I am loading the VC with the xib:
ShareViewController *shareViewController = [[ShareViewController alloc] initWithNibName:@"ShareViewController" bundle:nil imageName:imageSelected ];
shareViewController.modalPresentationStyle = UIModalPresentationFormSheet;
float fW = shareViewController.view.frame.size.width;
float fH = shareViewController.view.frame.size.height;
shareViewController.preferredContentSize = CGSizeMake(fW, fH);
[self presentViewController:shareViewController animated:YES completion:^(){}];
In iOS8 simulator here is NSLog output:
KIStd[28103:762368] Entering ShareButtonPressed
KIStd[28103:762368] initWithNibName/image entry
KIStd[28103:762368] viewDidLoad entry
KIStd[28103:762368] viewDidLoad exit w:596.000000, h:400.000000
KIStd[28103:762368] initWithNibName/image exit w:596.000000, h:400.000000
KIStd[28103:762368] viewWillAppear Entry w:596.000000, h:400.000000
KIStd[28103:762368] viewWillAppear exit w:596.000000, h:400.000000
KIStd[28103:762368] viewDidAppear entry
KIStd[28103:762368] viewDidAppear exit w:596.000000, h:400.000000
In iOS7 simulator here is NSLog output:
KIStd[28186:60b] Entering ShareButtonPressed
KIStd[28186:60b] initWithNibName/image entry
KIStd[28186:60b] viewDidLoad entry
KIStd[28186:60b] viewDidLoad exit w:596.000000, h:400.000000
KIStd[28186:60b] initWithNibName/image exit w:596.000000, h:400.000000
KIStd[28186:60b] viewWillAppear Entry w:540.000000, h:620.000000
KIStd[28186:60b] viewWillAppear exit w:540.000000, h:620.000000
KIStd[28186:60b] viewDidAppear entry
KIStd[28186:60b] viewDidAppear exit w:540.000000, h:620.000000
This shows the problem quite clearly.