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

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -