How can I see values of Object in NSLog?

Chatar Veer Suthar picture Chatar Veer Suthar · Feb 28, 2011 · Viewed 35.2k times · Source

Suppose I have an object containing some data.

How can I see that data using NSLog?

If anyone is not clear about my question, then can ask me again.

Answer

Satya picture Satya · Feb 28, 2011

If you want to see an NSArray and NSDictionary and etc objects then you can directly print like NSLog(@"%@",object);

If it is an user defined object then you need to display by calling with property (attribute).

User defined object with name object and properties like

NSString *property1;
int property2;
NSMutableArray *property3;

Print them in the console as follows:

NSLog(@"%@, %d, %@" object.property1,object.property2,object.property3);