Closed bygong closed 7 years ago
I will take a look at it. One quick thing to do is to log a statement for all the life cycle functions (eg. viewDidLoad, etc.) for each view controller and watch how the views are initiated.
Here is an example of a function that prints the class, file and function name when called:
func logFunctionName(file:String = #file, fnc:String = #function, line:(Int)=#line) {
if let className = file.components(separatedBy: "/").last?.components(separatedBy: ".") {
print("\(className[0]):\(fnc):\(line)")
}
}
Yes I did that, and my iPhone behaves just like an portrait IPad: Load Masterview-> load Detailview-> detailview appear, which should've been only load masterview -> masterview appear on iphone
I had done my duckduckgo, but something weird after I tried mess with my app and iPhone 6:
1.On simulator, the app launches with only calling "viewdidload" of masterviewController, and only shows masterview at first correctly. On my iphone, the app also calls "viewdidload" of detailviewController after masterviewController and shows the detailview at first.
Everything works fine on simulator. My iPhone WAS once running it correctly, after I attemped its limitation like unplug it while running or delete the app while debugging, it finally broke up :( don't do that. Tried everything like reboot or reinstall. Would you please see what you can do or just if it runs correctly on your phone?
Follow-up: I'm now pretty sure they are because the app incorrectly collapses on my iPhone.