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 -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -