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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:29:51+00:00 2026-05-27T21:29:51+00:00

There’s a strange issue with some of things I am using. Custom tableViewCell or

  • 0

There’s a strange issue with some of things I am using. Custom tableViewCell or db. In My app I made subclassing of UITableViewCell. My subviews are not transparent, so there shouldn’t be scrolling issues or impact on productivity. They look fine and only the problem is that I can see only 10 first cells, that after I am getting the same names of the NAME label and others repeated, while are fetching the right ids from database. It looks like

CAT id=12 >> DOG id=18

And in the place of CAT should be DOG. Clicking on CAT cell, I am getting DOG title. So it says, the label of viewCell is lier.

I tried to run same db selects in SQLiteStudio and they are OK. I am getting the full set of records. Did someone face the same issue and where’s the evil?

The DBAccess method:

-(NSMutableArray*)getNominals:(int)subCountryID
{
NSMutableArray *nominals=[[[NSMutableArray alloc]init]autorelease];
const char* sqlNominals=sqlite3_mprintf("SELECT noms.nominalID, noms.nominal,noms.nominalName,noms.nominalImg,noms.priority\
FROM nominals AS noms\
INNER JOIN NominalsAndSubCountriesRelation as rel\
ON noms.nominalID=rel.NominalID\
WHERE rel.SubcountruID=%i\
ORDER BY noms.priority",subCountryID);

sqlite3_stmt *statement;
int sqlResult = sqlite3_prepare_v2(database, sqlNominals, -1, &statement, NULL);

if ( sqlResult== SQLITE_OK)
{
    while (sqlite3_step(statement) == SQLITE_ROW)
    {
        Nominal *nom=[[Nominal alloc]init];
        nom.nominalID=sqlite3_column_int(statement, 0);
        char *nominal=(char *)sqlite3_column_text(statement, 1);
        char *nominalName=(char*)sqlite3_column_text(statement, 2);
        char *nominalImg=(char*)sqlite3_column_text(statement, 3);
        nom.nominal=(nominal)?[NSString stringWithUTF8String:nominal]: @"";
        nom.nominalName=(nominalName)?[NSString stringWithUTF8String:nominalName]: @"";
        nom.nominalImg=(nominalImg)?[NSString stringWithUTF8String:nominalImg]: @"";
        [nominals addObject:nom];
        [nom release];
    }
    sqlite3_finalize(statement);
}
else
{
    [self dbConnectionError];
}
return nominals;
}


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

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [self.nominalsArr count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
NominalsCustomCell *cell =(NominalsCustomCell*)[self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) 
{
    cell = [[[NominalsCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    Nominal *nominalsObj=[self.nominalsArr objectAtIndex:[indexPath row]];
    [cell setTheNominals:nominalsObj];
}
return cell;
}

Thank you in advance.

  • 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-05-27T21:29:52+00:00Added an answer on May 27, 2026 at 9:29 pm

    Move the following code

    Nominal *nominalsObj=[self.nominalsArr objectAtIndex:[indexPath row]];
    [cell setTheNominals:nominalsObj];
    

    outside of the if (cell == nil) block, since it should be set whenever a cell is set up, no matter if new or a reused one. In your case you’re setting up data for only the newly created cells – reused ones are simply brought up by UITableView and displayed with originally set up data.

    Read some more about how the UITableView cell reusing works.

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

Sidebar

Related Questions

There is a known issue with using jquery fadeOut, fadeIn, and fadeToggle, when fading
There was some code like this: // Convenience to make things more legible in
There is this strange situation I'm fighting on. I have 3 pages, les call
We're building an app, our first using Rails 3, and we're having to build
There are things like f.call(...) f.apply(...) But then there's this (1, alert)('Zomg what is
There is a constant I'm using from the iOS SDK. I printed out the
There are some Delegates predefined in C# I know these: EventHandler // Default event
There are some posts that asks what the difference between those two are already.
There are several tabs in GUI runner of NUnit: I understand that using Console.WriteLine
I am using Paperclip to handle profile photo uploads in my app. They upload

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.