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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:35:13+00:00 2026-06-15T11:35:13+00:00

I am trying to transition from a view controller to a table view controller

  • 0

I am trying to transition from a view controller to a table view controller programmatically (vs. with a storyboard segue), using this code:

[self.navigationController pushViewController:photosTVC animated:YES];

However, I get an “assertion error” when the table view controller is loading; specifically, on the second line of this method:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Photo";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
...

The table view controller loads fine when transitioning to it using a segue, but just not when I transition this way. Any ideas I could try would be much appreciated!

Thanks for reading.

EDIT: The full error text is below:

Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:4460

  • 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-15T11:35:15+00:00Added an answer on June 15, 2026 at 11:35 am

    To use [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; the cell has to be registered using registerNib:forCellReuseIdentifier: or registerClass:forCellReuseIdentifier: which is done for you if you’re using storyboard.

    So use just this method, [tableView dequeueReusableCellWithIdentifier:CellIdentifier] when you’re doing it programatically unless there are specific reasons not to.

    EDIT:

    UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil)
    {
        // or whatever cell initialisation method you have / created
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am trying to transition from one view controller to another with a
I am trying to modal present a view controller like below: UIStoryboard *storyboard =
I am trying to dismiss a view controller from bottom to top instead of
I'm trying to make a custom segue so that the destination view controller slides
I'm trying to do a transition from MySQL to SQLite for a small site.
I'm trying to create a transition between two scenes, this is a dumbed down
I'm trying to create a table of information in a database query using Zend
I'm trying to make a pushViewController slide in from the left, not the right,
I'm trying to render a custom flash message from a Devise controller. It is
I'm trying to mimic the Camera app transition from the front to back camera..

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.