skipDescendents
INDEX>Foundation>NSDirectoryEnumerator
サブディレクトリを調べずに、スキップします
解説
サブディレクトリを調べずに、スキップします。
返り値
( void )
なし
引数
フレームワーク
Foundation
クラス
NSDirectoryEnumerator
Instance Methods
使用可能
10.0
参照
-fileAttributes
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSString *pname; NSString *str = @"~/";//ユーザーディレクトリ NSFileManager *myFile = [ NSFileManager defaultManager]; NSDirectoryEnumerator *direnum; [myFile changeCurrentDirectoryPath:[str stringByExpandingTildeInPath]]; direnum=[myFile enumeratorAtPath:@"Pictures"];//ディレクトリ列挙オブジェクトを"Pictures"ディレクトリにする while (pname = [direnum nextObject]) { if ([[pname pathExtension] isEqualToString:@"rtfd"]) {//拡張子がrtfdなら [direnum skipDescendents]; //サブフォルダを列挙せずに } else { NSLog(pname); } } } @end