Hey all,
I am retrieving a .json file every few seconds and trying to save it into my mainBundle. To save it I am using
Code:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"json" inDirectory:@"jsonFile"];
[responseString writeToFile:filePath
atomically:YES
encoding:NSUTF8StringEncoding
error:NULL];
jsonFile is a folder in my project folder and I have dragged that into my xcode project.
This is writing the file because I can get info from it in my NSLog like
Code:
NSLog(@"userRole %@", [[json objectForKey:@"session"] objectForKey:@"userRole"]);
But when I check the file in my jsonFile folder it doesn't change. And I need to change it because I have other stuff accessing that file. If anyone knows why this is happening I would really appreciate it.