Why does clearing NSUserDefaults cause EXC_CRASH later when creating a UIWebView?

前端 未结 4 1054
误落风尘
误落风尘 2020-12-15 03:36

Before I begin, I should tell you that this only happens in iOS 5.1. Before the most recent update, this had never happened and it still does not happen on any othe

4条回答
  •  眼角桃花
    2020-12-15 03:57

    It sounds like you're removing some sort of private preference, which is probably a new bug, either with NSUserDefaults (you shouldnt be able to remove it) or UIWebView (it should cope with a missing entry).

    Have you tried the method from the other answer (setting a blank dictionary?). Does that give the same results?

    How about if you get the dictionary representation of NSUserDefaults, get all the keys, and iterate through those, removing the objects? (let me know if you need a code sample for that).

提交回复
热议问题