I have created a simple Xcode 4.2 project with a empty view controller. I added a json file to this project (i not had a resouces folder/group and so i have create these resouces folder and group). So, in my iphone simulator i can read this json file correctly. When i have tested my example app on my device I had a error: i can't read the json file: Why? I use this simple code lines:
NSString *filePath = [[NSBundle mainBundle] pathForResource:CONFIGURATION_FILE_NAME ofType:CONFIGURATION_FILE_TYEPE];
NSString *jsonString = [[NSString alloc] initWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error: NULL];
With JSON VIEWER, opening, searching and managing JSON files on your iPhone or iPad will no longer be a problem. To use it, touch the JSON file in any application, select "Open with .." And select JSON VIEWER.
Jayson is a simple yet powerful JSON viewer and editor with Siri Shortcuts, Share Sheet Actions and URL schemes. Features include: - Browse JSON files stored on your device. - Toggle between viewing JSON in a table or as syntax highlighted text.
I have solved... in my code the CONFIGURATION_FILE_TYEPE is a define @"JSON".. i have changed this with @"json".. this work well on device and simulator!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With