iOS: NSString的方法getFileSystemRepresentation:maxLength:

来源:互联网 发布:foobar2000 linux 编辑:程序博客网 时间:2024/04/29 22:47

- (BOOL)getFileSystemRepresentation:(char *)buffer maxLength:(NSUInteger)maxLength



char filenameBuffer[13];


BOOL success;


success = [@"/mach_kernel" getFileSystemRepresentation:filenameBuffer maxLength:12];


// success == NO


// Changing the length to include the NULL character does work


success = [@"/mach_kernel" getFileSystemRepresentation:filenameBuffer maxLength:13];


// success == YES