Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print in Console Xcode?

I am using afnetworking to parse JSON data. I want to print the data on the console.

How do i print this

self.videoMetaData = [JSON valueForKeyPath:@"data.items.video"];

i tried this

NSLog(@" data %@",videoMetaData);

it works when i have

NSArray *videoMetaData = [JSON valueForKeyPath:@"data.items.video"];
like image 911
user1951876 Avatar asked Feb 06 '13 00:02

user1951876


1 Answers

As mentioned in the comments you have to use NSLog(@" data %@", self.videoMetaData); to log the data. There is no variable called videoMetaData.

Having said that, you might want to have a look how to examine objects and variables using the debugger. Have a look at this for example: http://www.cimgf.com/2012/12/13/xcode-lldb-tutorial/

There are some good videos on lldb from WWDC 2012 on developer.apple.com (you have to be a registered developer in the iOS or Mac Developer Program)

like image 55
Sebastian Avatar answered Sep 27 '22 19:09

Sebastian