Jason Lee Jason Lee - 1 year ago 113
Objective-C Question

How can I debug in a framework in Xcode?

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 of both projects.

The
networkLib
project outputs a framework, called
myNetKit.framework
, which is used by
usingLibDemo
.

enter image description here

Now I successfully use
myNetKit.framework
to login, but sometimes it crashes, maybe in main() without stack information, but sometimes Xcode gives me the stack info like below:

enter image description here

So I know where it crashes:

enter image description here

But the
Utils.m
is not exposed, how Xcode gets the stack info and the crash line, and eventually open the source file for me? Because that I have the source code in my disk?

If so, how can I debug the
myNetKit.framework
step by step, when it is not crashed?

Thanks a lot for any tips.

Answer Source

You can also add the entire library (networkLib) project into your project and link the library dynamically by adding dependency in project settings. So you can have all the source code within your project. So you can debug it in run time.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download