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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:03:50+00:00 2026-06-08T20:03:50+00:00

I tried this but getting an exception error at cellforrowatindexpath Below is the exception

  • 0

I tried this but getting an exception error at cellforrowatindexpath

Below is the exception I got.

Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1914.84

if(aTableView==specTable)
{
    static NSString *CellIdentifier = @"cell";
    UITableViewCell *cell = [specTable dequeueReusableCellWithIdentifier:CellIdentifier];
    if(cell==nil)
    {
        cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2
                                    reuseIdentifier:CellIdentifier];

    }

    return cell;

} 
else 
{    
    static NSString *CellIdentifier2 = @"cell2";
    UITableViewCell *cell= [table2     dequeueReusableCellWithIdentifier:ReviewCellIdentifier2];
}

return cell;
  • 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-08T20:03:52+00:00Added an answer on June 8, 2026 at 8:03 pm

    Two problems:

    1. You never return cell2. At the end of this method, you always return cell, regardless of whether the sender table view was equal to the first or second one.
    2. You don’t create the cell as you do in the first part if in the second part (the else branch) the dequeueReusableCellWithIdentifier: message returns nil.

    All in all:

    if (aTableView == specTable)
    {
        static NSString *cellIdentifier = @"cell";
        UITableViewCell *cell = [specTable dequeueReusableCellWithIdentifier:cellIdentifier];
        if (cell == nil)
        {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2
                                        reuseIdentifier:CellIdentifier] autorelease]; // you were also leaking memory here
    
        }
    
        return cell;
    
    } 
    else 
    {    
        static NSString *cellIdentifier2 = @"cell2";
        UITableViewCell *cell2 = [table2 dequeueReusableCellWithIdentifier:cellIdentifier2];
        if (cell2 == nil)
        {
            cell2 = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2
                                        reuseIdentifier:CellIdentifier] autorelease];
    
        }
        return cell2;
    }
    
    return nil; // just to make the compiler happy
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried this solution with Elmah.XmlFileErrorLog but I'm getting following exception System.ArgumentNullException was unhandled
I am getting this error: Exception in thread main java.lang.OutOfMemoryError: Java heap space at
I am getting this error Thread [TimerDemo(185)id=307040256] (Suspended (exception ClassCastException)) UiApplication.getUiApplication() line: 462 TimerDemoTask$1.run()
I sneaked through similar posts, but found no solution. I am getting this Exception
I am trying to connect to the database but I am getting this exception:
I tried to specify this generic but I am getting multiple errors: public void
I have tried this but it does not work (even if I specify .wav
I have tried this but it doesn't work: tell application Preview set myfile to
How can I make this input transparent? <input type=text class=foo> I've tried this but
How can I join 2 Point3f arrays together? I have tried this but it

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.