Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 debugger no objective-c description available

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?

like image 678
James Kuang Avatar asked Sep 27 '13 17:09

James Kuang


People also ask

How do I debug in Objective C?

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.

How do I run debugger in Xcode?

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.

Where can I find NSLog?

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.

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.


2 Answers

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.

like image 99
danielbeard Avatar answered Sep 19 '22 15:09

danielbeard


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
like image 26
James Kuang Avatar answered Sep 21 '22 15:09

James Kuang