iPhone – Check the file extension in Objective-C

How to check the extension of files in the directory or search for some extensions, and different extensions, and any suggestions for doing this for iphone applications

Best wishes

You can use NSFileManager’s -contentsOfDirectoryAtPath: error: method to get the inclusion An array of directory contents (as strings). NSString has a -pathExtension method that makes it easy to get the file extension. All that’s left is to iterate through the array, looking for a string that matches the extension you are looking for. Or, You can use -filteredArrayUsingPredicate: to identify the matching string.

How to check the extension of the file in the directory or search for some extensions, and different extensions, and for the iphone application Any suggestions for doing this

Best wishes

You can use NSFileManager’s -contentsOfDirectoryAtPath:error: method to get An array containing the contents of the directory (as a string). NSString has a -pathExtension method that makes it easy to get the file extension. All that remains is to iterate the array, looking for a string that matches the extension you are looking for. Or , You can use -filteredArrayUsingPredicate: to identify the matched string.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1099 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.