getCString:maxLength:
バッファに指定した長さのC文字列を返します
-(void)getCString:(char *)buffer maxLength:(unsigned)maxLength
解説
■10.4以降非推奨。
(getCString:maxLength:encoding: を使います。)
バッファに指定した長さのC文字列を返します。
返り値
( void )
なし
引数
( char * )buffer
バッファ
( unsigned )maxLength
最大文字数
フレームワーク
Foundation
クラス
NSString
Instance Methods
使用可能
10.0
参照
- cStringLength
- canBeConvertedToEncoding:
+ defaultCStringEncoding
- getCharacters:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { char cBuffer ; [@"text" getCString:&cBuffer maxLength:4]; [info setStringValue:[[NSMutableString alloc] initWithCString:&cBuffer ]]; } @end