How can I debug in a framework in Xcode?

后端 未结 6 1127
无人及你
无人及你 2020-12-14 21:37

I have two projects, one is the networkLib for login and some other network function, the other is the usingLibDemo. So I have all the source code

6条回答
  •  Happy的楠姐
    2020-12-14 22:09

    When the library is built with all symbols, it contains full paths to the each source file embedded in itself. You can actually see this if you open the .a with a hex viewer. With this in place, the XCode will know how to get to the source file.

    Setting breakpoints is somewhat more challenging. You basically have to make XCode slowly discover source files from your library by stepping into methods in those file. Once XCode has opened the file, you can set the breakpoint anywhere in it.

    It is a bit painful but it works and you do not have to make the library project a subproject if you do not want to.

提交回复
热议问题