Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7869417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:18:48+00:00 2026-06-03T01:18:48+00:00

At first i’m trying to access local file in my app folder: NSData *data

  • 0

At first i’m trying to access local file in my app folder:

    NSData *data = [NSData dataWithContentsOfFile:
                                      [@"countries.json" stringByExpandingTildeInPath]];

result is always NULL

then i tried to check is file exists:

    NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    NSString* foofile = [documentsPath stringByAppendingPathComponent:@"countries.json"];
    BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:foofile];

it doesn’t exist, and i use following code to access my json file:

    NSString *data1 = [[NSBundle mainBundle] pathForResource:@"countries" ofType:@"json"];
    NSData *data2 = [[NSData alloc] initWithContentsOfFile:data1];

it getting the file but when i try to parse it:

    NSDictionary *dict1 =[data2 yajl_JSON];

i getting an error:

    [NSConcreteData yajl_JSON]: unrecognized selector sent to instance 0x6838d60

My questions is next:

  • Is there any chance to convert NSData to NSConcreteData?

  • Am i using the right approach to access data?


Api documentation – http://gabriel.github.com/yajl-objc/

Screenshot of my Xcode Build Phases:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:18:53+00:00Added an answer on June 3, 2026 at 1:18 am

    According to the YAJL documentation the method you are trying to invoke does in fact exist.

    That leaves only one option; you have not fully linked against the YAJL framework.

    Make sure it shows up within the list of linked frameworks/libraries of your App target just like CFNetwork.framework shows up in my example.

    enter image description here

    Since the method you are trying to invoke is in fact part of a category on NSData, make sure you include -ObjC in your Other Linker Flags.

    enter image description here

    From Apple’s Technical Q&A.

    This flag causes the linker to load every object file in the library
    that defines an Objective-C class or category. While this option will
    typically result in a larger executable (due to additional object code
    loaded into the application), it will allow the successful creation of
    effective Objective-C static libraries that contain categories on
    existing classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First some background. I inherited a project where the build file was already written
First, let us assume that local type inference is the sort of type inference
first I used onDestroy() method as below to make something when my app is
First of all, some background: I'm trying to get in a list of integers
First let me phrase the proper question: Q: There is a file containing more
I am trying to render a haml file in a javascript response like so:
First of all, i am not trying to hack into anything or anyones e
We're building an app, our first using Rails 3, and we're having to build
first of all, I'm not good with jQuery and coding. I'm trying to achieve
First off if you're unaware, samba or smb == Windows file sharing, \\computer\share etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.