forum

Home / DeveloperSection / Forums / How to use coverted nsstring into FSCreateDirectoryUnicode?

How to use coverted nsstring into FSCreateDirectoryUnicode?

Royce Roy 1252 11-Jan-2016
I'm a beginner in Objective-C, I am trying this code in our app but its not working correctly. I think on calling FSCreateDirectoryUnicode- I don not get the correct length.
Can you tell me how can I get the correct length or what will be the simplest way to do it?
this is my code:
NSString *strObj = @"DirectoryName";
NSData *dataObj = [strObj dataUsingEncoding:NSUnicodeStringEncoding
allowLossyConversion:NO];
FSCreateDirectoryUnicode(&aFolderFSRef, [strObj length], [dataObj bytes],
kFSCatInfoNone, NULL, &newFolderFSRef, NULL, NULL);

Updated on 13-Jan-2016

Can you answer this question?


Answer

1 Answers

Liked By