Xcode 4 debugging

橙三吉。 提交于 2019-12-06 06:11:02

问题


since migrating to Xcode 4 I am totally perplexed by the debug view inasmuch as I am unable to see the values of arrays / dictionaries etc.

Under Xcode 3 I could view debug console and see the actual values stored?


回答1:


Debugging information now appears in the debug navigator (Cmd-5) and the debug area (Shift-Cmd-Y).

You can have these areas show up by default when you run the application (or hit a breakpoint) by toggling the options in the "Behaviors" tab of Xcode's preferences.




回答2:


To see values inside arrays in xcode debug area choose the GDB debugger in your project scheme and have the variables you want to see defined as private variables.

Starting in xcode 4 the default debugger is LLDB. To change to GDB click on project name in schemes (next to "Stop" button near top of project window) Choose "Edit Scheme..." and then choose GDB in Debugger drop down.

One way to define a property variable so it can be seen in debug area is to define a private variable in the header file which has the @property statement.

@interface SomeObject : NSObject {
@private
    NSMutableArray *someArray;  // Allows visibility in Debug Area 
}
@property (nonatomic, strong) NSMutableArray *someArray;
@end


来源:https://stackoverflow.com/questions/5376199/xcode-4-debugging

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!