I have an array which contains text data and image data.If data is text i need to display it in a label otherwise in an imageview.But how to detect whether its a text or image?
1 Answer
if( [[ array objectAtIndex: yourIndex] isKindOfClass: [ Name_of_the_class_your_want_to_check_for class ]] )
4 Comments
Neo
the questioner has mention to display it in a label so i assume its a text
giorashc
+1 well don't expect him to accept your answer anyways ... (And not because it is not correct) :)
priyanka vijesh
then what is for image class and video class
Neo
image are saved directly as UIImage object but you can save it also as NSData but normally for video only the paths are saved in the array