objective c - How can I check if a file is an image file without checking the path extension? -
i need differentiate between text file , image file without taking path extension.
i check if file image or not. after searching, there way check mimetype path extension, however, solution verify file's content itself.
uiimage *image = [uiimage imagenamed:@"somefile.xyz"]; if (image == nil) { nslog(@"this text file"); }
if image nil means file may text or type of file.
Comments
Post a Comment