how to find multiple files with wildcard expression in objective-c
问题 How do I get hold of all the *.bmp files (or *.xyz in general) in my Document folder, writing an iPhone 3.0 SDK? 回答1: You need to use NSFileManager 's contentsOfDirectoryAtPath:error: function. Note that this does not traverse subdirectories and extension cannot contain a . . -(NSArray *)findFiles:(NSString *)extension { NSMutableArray *matches = [[NSMutableArray alloc]init]; NSFileManager *manager = [NSFileManager defaultManager]; NSString *item; NSArray *contents = [manager