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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -