What are some methods to debug Javascript inside of a UIWebView?

后端 未结 8 1924
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 17:58

I\'m trying to figure out why something with Javascript isn\'t working inside of a UIWebView. To my knowledge, there is no way to set a breakpoint inside of XCode for a js f

8条回答
  •  星月不相逢
    2020-11-28 18:38

    If you're using iOS >= 6 and you have mountain lion (10.8) or Safari >= 6, you can just:

    1. Open the application in the simulator (or your device in XCode >= 4.5.x).
    2. Open Safari (go to Preferences -> Advanced and make sure "Show Develop Menu in Menubar" is on.
    3. From the Menu-bar (of Safari) select Develop -> iPhone Simulator -> [your webview page].

    That's it !

提交回复
热议问题