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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:37:39+00:00 2026-06-12T09:37:39+00:00

I am trying to build a multilayer xmlparser which shows data in a tableview

  • 0

I am trying to build a multilayer xmlparser which shows data in a tableview and switches to the next view based on the selected row (most likely to the same viewcontroller).

I started with storyboard segues but as i am using dynamic cells i dont know how to create more than one push segue (because it needs to push to various viewcontrollers). So i kept the storyboard views, deleted all the segues and used the code below instead.

however it throws this exception when the new view tries to pupulate the row:

Terminating app due to uncaught exception
‘NSInternalInconsistencyException’, reason: ‘UITableView dataSource
must return a cell from tableView:cellForRowAtIndexPath:’

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"index: %i", indexPath.row);

    switch (indexPath.row) {
        case 0:
        {
            DetailViewController *detailViewController = [DetailViewController alloc];
            [self.navigationController pushViewController:detailViewController animated:YES];
            break;
        }
        //...
        default:
        {
            LayerViewController *layerViewController= [LayerViewController alloc];
            [layerViewController setStartUpWithIndex:indexPath.row andLayer:layercount];
            [self.navigationController pushViewController:layerViewController animated:YES];
            break;
        }


    }

}

setStartUpWithIndex:andLayer: is my init method…

the problem does not occur when im pushing via storyboard segue with the following segue code:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
        NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
        [[segue destinationViewController] setStartUpWithIndex:indexPath.row andLayer:layercount];
}

i think i am missing something the “segue” method does which i need to include in my didSelectRowAtIndexPath as cellForRowAtIndexPath: works fine in the first layer of the view.

requested edit:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"LayerCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    cell.textLabel.text = [[articles objectAtIndex:indexPath.row]objectForKey:@"HerstellerName"];
//    cell.textLabel.text = @"ololol";

    return cell;
}

the articles array is working btw

  • 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-12T09:37:40+00:00Added an answer on June 12, 2026 at 9:37 am

    You aren’t creating any cells. I don’t know why Apple didn’t include this in the default implementation, but after:

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    

    You need to add:

    if (cell==nil){
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    

    Otherwise you’re just relying on dequeued cells which won’t exist when the tableView loads.

    Edit: And if you’re not using ARC, you need to wrap that alloc method with an autorelease.

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

Sidebar

Related Questions

Im trying to build an activty stream which automatically displays the the most recent
I'm trying build a method which returns the shortest path from one node to
I am trying build a DataTable one row at a time using the following
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
Trying to build a micro-CMS (of sorts), which needs to dish out content i.e.
Im trying to build a feeds application in php in which im using a
Im trying to build a form that calculates a total price based on a
am trying to build a point system which checks how much points a user
Trying to build a linq query based on parameters a user selects (reporting) but
Trying to build up a query to filter on data in the following manner

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.