Wednesday, October 16, 2013

IOS obtain documents folder problem

I wrote a program that needs to sandbox documents folder to share files with users,
Already. Plist file to set Application supports iTunes file sharing is YES
Get documents folder of the code is as follows:
NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentationDirectory, NSUserDomainMask, YES);
NSLog (@ "% @", [paths objectAtIndex: 0]);

Results:
/ Users / bingchanller / Library / Application Support / iPhone Simulator/5.0/Applications/C5006DC7-CC88-42F9-B02C-EB0CC686DB86 / Library / Documentation

That is not to obtain documents folder, but documenta then shared with the user in the app will be the right time for less than the correct path causes can not share files
Consult Great God this is what happens
Reply:
NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);

You set the read path wrong Oh, yes NSDocumentDirectory, not NSDocumentationDirectory
Reply:
http://blog.csdn.net/qijianli/article/details/7735422
NSDocumentDirectory documents is the path, NSDocumentationDirectory is Documentation path. The two are not the same.
Reply:
http://blog.csdn.net/qijianli/article/details/7735422
NSDocumentDirectory documents is the path, NSDocumentationDirectory is Documentation path. The two are not the same.
Reply:
I only see, learn
Reply:
After reading feel like upstairs. Also lamented, minor areas that success lies.
Reply:
 
NSString * documentsPath = [NSHomeDirectory () stringByAppendingPathComponent: @ "Documents"];

No comments:

Post a Comment