Different behaviour in iOS 7 and iOS 8 on -(void)viewDidAppear:(BOOL)animated on Partial Curl VC

删除回忆录丶 提交于 2019-12-20 06:13:32

问题


-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    //Reset all NSUserDefaults values
}

My app was previously working fine in iOS 7 but after upgraded to iOS 8, it is no longer working.

This is happening in my parent VC where user is required to select some option in another (child) VC which transit via "Partial Curl". In iOS 8, seems like all my options are not saved in child VC anymore when I transit back to my parent VC.

FYI I store my options selection in child VC inside NSUserDefaults and access them again in parent VC.


回答1:


Upon checking, I realised in iOS 7, the function (void)viewDidAppear:(BOOL)animated only called once during first load. However, in iOS 8, this function is called everytime I transit back from the child VC via "Partial Curl". Therefore whatever options that chosen in child VC got reset when transit back to parent VC.

This is the different between iOS 7 and iOS 8.



来源:https://stackoverflow.com/questions/26231738/different-behaviour-in-ios-7-and-ios-8-on-voidviewdidappearboolanimated-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!