In Xcode 4, when I use the debugger to print an NSArray count, it would show in the console like this:
po [self.array count]
3
In Xcode 5, doing this gives me
[no Objective-C description available]
This seems to be the case with all numerical types. What is the change or reasoning behind this behavior?
dSYM files, go to Project->Edit Project Settings->Build->Build Options->Debug Information Format and make sure you have a dSYM file. You should keep these files around for every build you release. The iPhone SDK generates these files by default but you will need to turn in on manually for Mac builds.
When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.
NSLog() output on the simulator does indeed show up in the Console Mac OS X application. Go to All Messages and then filter based on your app name to get rid of the fluff, and run again. You'll see it in your output if the NSLog code is actually being hit during the execution of your program.
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.
The command po
stands for "Print Object".
self.array.count is type NSUInteger
which is not an object.
Use the p
command instead, which is intended to print non object values.
E.g.
p self.array.count
The LLDB docs are a great resource.
In the meantime, I found that if you enclose any numerical type into an NSNumber, it would print out in the console like this:
int index = 1;
po index
[no Objective-C description available]
po @(index)
1
po @([self.array count])
3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With