我的代码如下:
NSArray *paths = NSSearchPathForDirectorIEsInDomains(NSdocumentDirectory,NSUserDomainMask,YES); Nsstring *documentsDirectory = [paths objectAtIndex:0]; NSDirectoryEnumerator *direnum = [[NSfileManager defaultManager] enumeratorAtPath:documentsDirectory]; Nsstring *pname; while (pname = [direnum nextObject]){ [musicArray addobject:[pname stringByDeletingPathExtension]];}
我想要做的是继续搜索其子文件夹,我将如何去做?
解决方法 它自动完成. From the documentation:总结An enumeration is recursive,including the files of all subdirectorIEs,and crosses device boundarIEs. An enumeration does not resolve symbolic links,or attempt to traverse symbolic links that point to directorIEs.
以上是内存溢出为你收集整理的iphone – NSDirectoryEnumerator和子文件夹全部内容,希望文章能够帮你解决iphone – NSDirectoryEnumerator和子文件夹所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)