Вы можете использовать FSPathMakeRef()
, чтобы сделать FSRef
из строкового пути UTF-8 C, и вы можете использовать -UTF8String
метод NSString
получить строку UTF-8 C:
FSRef fsref;
Boolean isDirectory;
OSStatus result = FSPathMakeRef([myString UTF8String], &fsref, &isDirectory);
if(result < 0)
// handle error
// If successful, fsref is valid, and isDirectory is true if the given path
// is a directory. If you don't care about that, you can instead pass NULL
// for the third argument of FSPathMakeRef()