Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug NSManagedObjects in XCode debugger?

How do you get to the values of your Entity (sub class of NSManaged Object) when in the XCode debugger? I get lost among the NSObject and _cd_XXX structures.

like image 619
KingAndrew Avatar asked Jun 02 '10 12:06

KingAndrew


People also ask

How do I debug my code in Xcode?

To set up your breakpoint, you simply need to open a project in Xcode or Android Studio, and click close to the code line number. That's how it looks in Xcode. You'll see a blue arrow appear, indicating that the execution will pause when it reaches that point.

Does Xcode have a debugger?

The Xcode debugger provides several methods to step through your code and inspect variables. You can precisely control execution of your code from a breakpoint, stepping into and out of called functions as necessary to determine where your bug occurs.

What is debugging executable in Xcode?

The “Debug executable” checkbox specifies whether or not you want to run with the debugger enabled. Once running, you can use Debug > Attach to Process on a process that has been launched with debugging disabled if needed. It seems like all this does is start your app with the debugger attached.


1 Answers

In the Debugger Console type

po [your_entity your_property]

I don't really know another useful way, as the entity may e.g. be faulted and also the NSManagedObject structure isn't really helpful, as you already noticed.

like image 119
Alfonso Avatar answered Oct 23 '22 01:10

Alfonso