views:

33

answers:

1

I have a lot of object of different classes in a scrollView. While doing some operations, I want to print the the parent class of each objects. How can I do it?

+4  A: 
-(NSString *) myClassName {
  return NSStringFromClass( [self class] );
}

-(NSString *) parentClassName {
  return NSStringFromClass( [super class] );
}

You can iterate through the subviews of a view like this:

for ( UIView *subview in theParentView.subviews ) {
  NSLog( @"%@" , subview );
}
drawnonward