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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:06:15+00:00 2026-06-08T18:06:15+00:00

I am getting this Exception in xcode4 with the iphone simulator: Terminating app due

  • 0

I am getting this Exception in xcode4 with the iphone simulator:

Terminating app due to uncaught exception 'NSInternalInconsistencyException'

It seems to be caused if you return no objects(return 0) back in the cellForRowAtIndex method. But I have mine set to return the cell.

Can anyone see what may be causing this error? Here is a bunch of screenshots:

Controller Configuration:
My Controller configuration

Prototype cell
prototype cell 1

attentionCell:
enter image description here

Storyboards:
Full view of the storyboards

Full Error:

**Assertion failure in -[UITableView 
_createPreparedCellForGlobalRow:withIndexPath:],           
/SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:6061
2012-07-30 14:34:16.660 Simple Storyboard[263:f803] Terminating app due 
to uncaught exception 'NSInternalInconsistencyException', 
reason: 'UITableView dataSource must return a cell from 
tableView:cellForRowAtIndexPath:'**

Here is the code:

#import "LWWBidTaskListController.h"

@interface LWWBidTaskListController ()
@property (strong, nonatomic)NSArray *tasks;

@end

@implementation LWWBidTaskListController

@synthesize tasks;

- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
    // Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];

self.tasks = [NSArray arrayWithObjects: @"Walk the dog", @"URGENT:Buy milk", @"Clean     hidden lair", @"Invent miniature dolphins", @"Find new henchmen", @"Get revenge on do-gooder heroes", @"URGENT: Fold laundry", @"Hold entire hold hostage", @"Manicure", nil];

// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;

// Uncomment the following line to display an Edit button in the navigation bar for this     view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
self.tasks = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:    (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
//#warning Potentially incomplete method implementation.
// Return the number of sections.
//return 0;
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
//#warning Incomplete method implementation.
// Return the number of rows in the section.
//return 0;
return [tasks count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:    (NSIndexPath *)indexPath//populates each cell
{
//static NSString *CellIdentifier = @"Cell";
//UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];


NSString *identifier = nil;
NSString *task = [self.tasks objectAtIndex:indexPath.row];
NSRange urgentRange = [task rangeOfString:@"URGENT"];
if (urgentRange.location == NSNotFound)
{
    identifier = @"plainCell";
}
else 
{
    identifier = @"attentionCell";
}
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];

// Configure the cell...

UILabel *cellLabel = (UILabel *)[cell viewWithTag:1];
cellLabel.text = task;

return cell;
}

What does that error mean and how can I fix it?

  • 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-08T18:06:17+00:00Added an answer on June 8, 2026 at 6:06 pm

    It looks as though you never create a cell. If you have never allocated and initialized a cell then there are none to dequeue.
    before the // Configure the cell.. line you need to check if a reusable cell was dequeued and if not, create one like so:

    if (cell == nil) {
      cell = [[UITableViewCell alloc]  initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    
      // Configure common elements here
    
    }
    
      // Now go on to configure specific elements for this row
    

    As you are using storyboard, perhaps you have not set up the prototype cell attributes correctly. The identifiers must match those in your method above.

    See this pic for where you find the prototype cell attributes Prototype cell setup. it is from this tutorial that may help you as well Ray Wenderlich and Storyboards

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

Sidebar

Related Questions

I'm getting this error message when I Build&Go: *** Terminating app due to uncaught
I'm getting this exception from facebook SDK: Fatal error: Uncaught OAuthException: (#506) Duplicate status
I am getting this exception sometimes while running my Windows Forms app for a
I keep getting this exception: Oops: CannotCompileException An unexpected error occured caused by exception
I'm getting this exception in my WPF app on one particular PC, on half
Any idea why I am getting this exception? Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean
I am getting this exception in my java project Caused by: java.lang.ClassNotFoundException: org.apache.axiom.om.OMDataSource at
I am getting this exception when trying to run my PHP unit tests: Fatal
I am getting this exception: Collection was modified; enumeration operation may not execute. Directly
Hello everyone I am getting this exception: The magic number in GZip header is

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.