getFileSystemRepresentation:maxLength:
ファイルシステムと合う文字列なら、YESを返してbufferに文字列を返します
-(BOOL)getFileSystemRepresentation:(char *)buffer: maxLength:(unsigned)maxLength:
解説
ファイルシステムと合う文字列なら、YESを返してbufferに文字列を返します。
(.cや.epsなどの拡張子がついているとNOを返します)
返り値
( BOOL )
YES/NO
引数
( char * )buffer
バッファ
( unsigned )maxLength
最大レンジ
フレームワーク
Foundation
クラス
NSString
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSString *str1 = @"aaa/bbb/ccc.c"; NSString *str2 = @"aaa/bbb/ccc"; char cBuffer1 ; char cBuffer2 ; ([str1 getFileSystemRepresentation:&cBuffer1 maxLength:13]) ?NSLog(@"YES"):NSLog(@"NO"); NSLog([[NSString alloc] initWithCString:&cBuffer1 ]); ([str2 getFileSystemRepresentation:&cBuffer2 maxLength:13]) ?NSLog(@"YES"):NSLog(@"NO"); NSLog([[NSString alloc] initWithCString:&cBuffer2 ]); } @end