Followup to yesterday's discussion about my bug...

Owen Hartnett owen at clipboardinc.com
Thu Feb 4 10:54:21 EST 2016


This is the bug where the view was cropped to the iPhone 4S size screen, even though it was running on an iPhone 6, but it ran OK on the iPad:

Here's what the problem was:

John Shockey got close when he wanted to peer at the info.plist file. Here's the situation:  There was a storyboard, and that was loaded in the applicationDidfinishLaunching. It was not mentioned in the info.plist file.

Comparing the info.plist to a newer info.plist showed the key "Main Storyboard file base name" which did not exist in the older plist.  Instead there was a key "Main Nib File base name" which pointed to a file mainWindow.xib.  All mainWindow.xib had in it was a window, with a fixed size of 320 x 480. So iOS was loading that window on startup, and stuffing the password view controller from the storyboard in it when it was loaded in code (specifically when it was made the rootViewController).  This caused the fixed size.  The remedy was as follows:  Add the key "Main Storyboard file base name" pointing to the storyboard, and remove the "Main Nib file base name" item.  This resulted in another error "There is no app delegate set. An app delegate class must be specified to use a main storyboard file."  Stack overflowing this message showed the fix to be replacing the last parameter of the UIApplicationMain() function (formerly nil) with NSStringFromClass([CamaXAppDelegate class]).  Now all is well.  

Thanks for your help.

-Owen

P.S. Although the "Shooting yourself in the foot in several programming languages" didn't have Swift listed, I propose the following:

SWIFT - You load up a revolver full of blank cartridges.  When you shoot yourself in the foot, the whole world blows up because the bullets were not optionals.

-O


More information about the MacTechGroup-discuss mailing list