Different behaviour in iOS 7 and iOS 8 on -(void)v

2020-05-03 11:17发布

-(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条回答
我想做一个坏孩纸
2楼-- · 2020-05-03 12:17

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.

查看更多
登录 后发表回答