First I try to access the local file in my application folder:
NSData *data = [NSData dataWithContentsOfFile:
[@"countries.json" stringByExpandingTildeInPath]];
the result is always NULL
then I tried to check if the file exists:
NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString* foofile = [documentsPath stringByAppendingPathComponent:@"countries.json"];
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:foofile];
it does not exist, and I use the following code to access my json file:
NSString *data1 = [[NSBundle mainBundle] pathForResource:@"countries" ofType:@"json"];
NSData *data2 = [[NSData alloc] initWithContentsOfFile:data1];
it gets the file, but when I try to parse it:
NSDictionary *dict1 =[data2 yajl_JSON];
I get an error message:
[NSConcreteData yajl_JSON]: unrecognized selector sent to instance 0x6838d60
My questions are as follows :
Api Documentation - http://gabriel.github.com/yajl-objc/
Screenshot of my Xcode build phases:

source
share