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 9074441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:38:12+00:00 2026-06-16T18:38:12+00:00

Hi I am new to programming. I have some issues with NSDictionary and Table

  • 0

Hi I am new to programming.

I have some issues with NSDictionary and Table cells. I Tried to find good tutorials, but did not find anything that could help me. I am using JSONKit to parse json. I have an older version of xcode and only have simulator 4.3.

What i would like to do is to parse my Json into a table with cells.

The json I want to parse:

{[{"n_id":"1","name":"Green","age":"23"}]}

My main problem.
I dont get any errors, but when i run the app it just close automatically.
When i comment out //cell.textLabel.text = [studName objectAtIndex:indexPath.row]; and replace it with just cell.textLabel.text = @”Test”; The app and the output works fine.
I am also able to get the NSLog(); values

I think my error is in the cell.textLabel.text = [studName objectAtIndex:indexPath.row];
Thanks in advance

//Json2ViewController.m

- (void)viewDidLoad {
[super viewDidLoad];



NSData * JSONdata =[[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://myurl.php"]];

 if([JSONdata length] == 0){
 [JSONdata release];
 return;
 }

NSArray *students =[JSONdata objectFromJSONData];

studName = [[NSMutableArray alloc] init];

for(NSDictionary *student in students)
{
    NSLog(@"Name: %@", [student objectForKey:@"name"]);
    NSLog(@"Age: %@", [student objectForKey:@"age"]);

    content = [student objectForKey:@"name"];
    if(content)
       [studName addObject:content];

}

}


 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}


    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}

// Configure the cell...
cell.textLabel.text = [studName objectAtIndex:indexPath.row];
return cell;

}

I am not sure about NSMutableArray.

//Json2ViewController.h

@interface Json2ViewController : UIViewController {
NSArray * list;
NSString * content;
NSMutableArray *studName;

}

  • 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-16T18:38:13+00:00Added an answer on June 16, 2026 at 6:38 pm

    Try this:

     //Declare NSMutableArray *studName= [[NSMutableArray alloc] init]; in your .h file.
    // 3. iterate the array; each element is a dictionary...
    
    
     for (NSDictionary *results in list)
        {
            // 3 ...that contains a string for the key "stunde"
            content = [results objectForKey:@"n_name"];
            if(content)
                [studName addObject:content];
        }  
    

    and in table delegate method cell for row at index

      // Configure the cell...
                cell.textLabel.text = [studName objectAtIndex:indexPath.row];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to PHP programming and have poor knowledge about it, but I want
I am a bit new to programming in jQuery/Javascript and am having some issues
I'm new to C++ programming, but have been working in C and Java for
I'm fairly new to programming in Objective-C. While I have been able to find
I am new in expect perl programming and have to write some scripts to
I am a newbie at Qt programming and I have some issues with the
I'm new to programming in Objective-C and have some C++ under my belt. As
I am new to programing and I have some difficulties getting AlertDialog working. I
i am new kernel programming.i have been trying to load this driver program for
I'm very much new to programming and have been doing fairly well so far.

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.