I have class Building in which i have one class member NSMutableArray *subnode.I have declared one more array buildingArray which stores the element of type Building.I have tried to print Building class object as shown in following code.But goes in only first for loop.
Second for loop of subnode array is not executing . Is this proper way of printing the object having the array as a one of its class member.
code:
for(Building *b in buildingArray)
{
NSLog(@"inside building array");
for(NSString *str in b.subnode)
{
NSLog(@"inside subnode array");
}
}
If this is for debugging purposes, I would recommend trying the following: Every object that inherits from
NSObjectinherits itsdescriptionmethod.Add this to
Building.m:You can then print the entire
buildingArrayby simply calling the following code: