标签:
NSFileManager *manager = [NSFileManager defaultManager]; NSString *home = [@"~" stringByExpandingTildeInPath]; NSMutableArray *files = [NSMutableArray arrayWithCapacity:42]; NSString *filename; for (filename in [manager enumeratorAtPath:home]) { if ([[filename pathExtension]isEqualToString:@"m"]) { [files addObject:filename]; } } for (filename in files) { NSLog(@"%@",filename); }
源码来自《Objective-C基础教程》
标签:
原文地址:http://www.cnblogs.com/ficow/p/5040783.html