As the title said, I want to debug some Core Data bugs. Instead of using NSLog everywhere in the code, is it possible to watch a entity’s attributes in XCode 4’s watch window? Like the “quick watch” tool in Entity Framework 4.0 of .NET.
As the title said, I want to debug some Core Data bugs. Instead of
Share
Any value that has a named variable assigned to it can be viewed in the debugger. In Xcode 4 it appears in the debugger’s left column. If you select the variable, you can use the contextual menu option “Print to console” to have a detailed description printed to the debugger console. This is useful when examining managed objects as they often contain more info than the list of variables can cleanly display.
(See- Xcode 4 Transition Guide:Control Program Execution in the Debug Area and Source Editor, Figure 5-9
In addition, you can issue any of the standard gdb commands from the command line in the debugger console. The most useful of the these commands is
powhich stands forprint object. Say you have an objectmyObjectthat has a propertyaProperty. You could examine it directly by using:If you create NSManagedObject subclasses, you also have the option of overriding the
descriptionmethod which allows you to produce custom descriptions of the object which will show up inprint to consoleand thepocommand.