문제

I installed the xcode 4.6. In the release notes I found below line:

Debugger can inspect elements within NSArray or NSDictionary objects.

I can view the values using "po" command. Is it referring same?

OR

Is there any other technique made avail for developer to inspect the elements of NSArray and NSDictionary without using "po" command?

도움이 되었습니까?

해결책 2

gdb window you can use po to inspect the object.

set breakpoint after the objects are added you can inspect what is in the dictionary

Question what is GDB?

gdb is in fact a prompt in the Console, where you can input commands. By typing "po object_name" you got the object content printed in the console. For More Detail

 NSMutableDictionary* dictForData = [[NSMutableDictionary alloc] init];
    [dictForData setObject:@"test1" forKey:@"string1"];
    [dictForData setObject:@"test2" forKey:@"string2"];

Output

(gdb) po dictForData
{
  string1 = test1;
  string2 = test2;
}

Another option for the Log Data.

setp 1 :enter image description here

step 2 : enter image description here

step 3 : enter image description here

step 4 : enter image description here

here is the methods which is use by me.

다른 팁

If the array has data, put a breakpoint next to it. It will stop execution at that point.

Then just hover over it.

Example:enter image description here

Next: enter image description here

Hope this helps. Don't need to "po" or print description...

EDIT:

I just did this:

enter image description here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top