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

  • SEARCH
  • Home
  • 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 8652455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:18:42+00:00 2026-06-12T14:18:42+00:00

I have a problem with the SBJSON Parser. I’m trying to get some information

  • 0

I have a problem with the SBJSON Parser. I’m trying to get some information from a website which gives back a json file. Then I parse that into a string and then into a dictionary (works fine). But when I want the last element (name) from that dict it just gives me an error. Here’s my code:

SBJsonParser *parser = [[SBJsonParser alloc] init];

self.videoId = videoId;
// Grab the contents from the url and save it in a string
NSString *content = [NSString stringWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://gdata.youtube.com/feeds/api/videos/%@?alt=json",videoId]] encoding:NSUTF8StringEncoding error:nil];
// Save the information from the string in a dict
NSDictionary *dict = [parser objectWithString:content error:nil];

NSArray *string = [[dict objectForKey:@"entry"] objectForKey:@"author"];

NSLog(@"%@", string);

Here’s the output:

2012-10-10 11:11:47.731 quoteGen[13862:c07] (
    {
    name =         {
        "$t" = CommanderKrieger;
    };
    uri =         {
        "$t" = "http://gdata.youtube.com/feeds/api/users/CommanderKrieger";
    };
}

)

How do I get the name or uri?

  • 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-12T14:18:43+00:00Added an answer on June 12, 2026 at 2:18 pm
    NSString *name = [[[string objectAtIndex:0] objectForKey:@"name"] objectForKey:@"$t"];
     NSString *urlString = [[[string objectAtIndex:0] objectForKey:@"uri"] objectForKey:@"$t"];
    

    I think it will be helpful to you.

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

Sidebar

Related Questions

I'm using SBJson to parse some JSON result from a webservice. The problem is
Have problem with linq expressions. I want to get from db some data ordered
I am trying to get an exchange rate from the iGoogle Calculator. I have
I'm having a duplicate JSON file problem. I have google places SBJSON files and
I have a problem with parsing a JSON result. This is what I get
I'm having a problem on parsing a JSON from Google Places. I have the
I have problem with UIWebView delay when the load image from url. In my
i have problem to show only day or month from dob in mysql. i
Have problem while getting data from Memcached on .NET MVC solution. I have this
I am trying to feed in some JSON data to my iPhone app, the

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.