Hi in my application i have an array. In that i have number of UIView and UIImageView Components, and i want to fetch each component from that array and have to know wether that is imageview or view, if that is imageview i have to change the image for that imageview.But i dont have any idea how to know wether the component is imageview or view. If any one know please let me know the way to recognize the component type. Please help me in this issue.
for (int i=0; i<[array count]; i++){
// here i have to know wether the component is imageview or view and based on that i have to do below operations
UIView *view1=[array objectAtIndex:i];
NSLog(@"%@",[array objectAtIndex:i]);
if (130==view1.tag){
view1.backgroundColor=[UIColor redColor];
}
UIImageView *image1=[array objectAtIndex:i];
if (132==image1.tag){
image1.image=[UIImage imageNamed:@"Approve2.png"];
}
}
Use
isKindOfClass
Example:
You can check by class introspection
Try this
Few extra things that you may feel handy