I have my video and images stored in the NSData format in a cache.I want to retrieve the image and show it on imageController also want to retrieve video and and show it on videoController.
I can distinguish them by looking towards the file extension. But the problem is in imageController i can init image by using the NSData:
NSData *data=[NSData dataWithContentsOfURL:[NSURL fileURLWithPath:filePath isDirectory:NO]];
UIImage *image=[[UIImage alloc]initWithData:data];
But how can i use the NSData to play the video?
If you can get their path extensions, you can just use separate implementations for each type. No need to have one way down the road, eh?