I have an array that may have objects of "Theme" class or "Language" class. Now I am Type Casting my method to Theme class manually. I want to check If array have objects of Theme class then Type cast it with Theme
cell.textLabel.text = [NSString stringWithFormat:@"%@",[(Theme *)[_listArray objectAtIndex:indexPath.row] name]];
_listArray may also objects of Language Class.
I have done
Class theClass = [[_listArray firstObject] class];
cell.textLabel.text = [NSString stringWithFormat:@"%@",[(theClass *)[_listArray objectAtIndex:indexPath.row] name]];
But it is not working...!!! How should I do this?
Thanks.