Here is the object, and have following attribute:
NSString attri1;
NSString attri2;
NSString attri3;
NSString attri4;
If I want to list the
If you want to dynamically access a property of an object, that can be done with Key Value Coding.
If the class is KVC-compliant, as most NS classes are, you can use valueForKey: or valueForKeyPath: to access a property with a string:
for(int i = 0; i < [array count]; i++) {
NSLog([[aObj valueForKey:[NSString stringWithFormat:@"attrib%d", i]]);
}