Here is where I am:
I have JSON files I need to mount into Objective C Objects
I have an XCode Project
I have dragged the folder of JSON files into my project and
created a blue "Documents" folder off of the root of the project.
However, it does not appear in the app sandbox in the ~/Library/... folder.
Despite searching both this site and others for a set of instructions to accomplish the above I have come up short.
I have also reviewed Apple's docs, and have found tangential information but not a straight forward description of how to accomplish the above.
Here is my code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0]; // Get documents folder
NSString *lessonsDirectory = [documentsDirectory stringByAppendingPathComponent:@"/lessons"];
NSString *filePath = [lessonsDirectory stringByAppendingPathComponent:@"/52aa2b6e9af9b73896095404.json"];
NSLog( filePath );
NSData *data = [NSData dataWithContentsOfFile:filePath];
//THE NEXT LINE ERRORS OUT -> "data parameter is nil'
NSArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
To recapitulate: How do I add files to /Documents directory in App Sandbox?