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

  • Home
  • SEARCH
  • 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 9239893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:05:44+00:00 2026-06-18T08:05:44+00:00

I have a customTableViewCell that has a property of type Marker. I use this

  • 0

I have a customTableViewCell that has a property of type Marker. I use this object to bind the UI elements like UILabel for example.

I have a TableSection object that I basically just use for grouped table to help manage things better. It looks like:

@interface TableSection : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, strong) NSMutableArray *array;

In my cellForAtIndexPath method, I do this:

    TableSection *tableSection = [self.markersList objectAtIndex:indexPath.section];
    Marker *m = (Marker *)[tableSection.array objectAtIndex:row];
    cell.marker = m;

I want to update this cell if information I grab from a web service has more information.

So I get the indexPath of the object in my tableview, then I try this:

- (void)updateIndexPath:(NSIndexPath *)indexPath marker:(Marker *)marker {
    MarkerTableViewCell *cell = (MarkerTableViewCell *)[self.MarkersTableView cellForRowAtIndexPath:indexPath];

For my first section of the tableView, cell.marker is what I expect it to be. In other sections however, cell.marker is nil. Is there a reason for this? thanks.

  • 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-18T08:05:45+00:00Added an answer on June 18, 2026 at 8:05 am

    How UITableView works is that it only contains the currently displayed cells, nothing more. So if the cell you are trying to access is not in the view then you will get nothing (or possibly garbage since the cells are reused).

    The only way I found to deal with this type of situation is the use the data array. Instead of making the marker tied to the cell make the marker tied to your data array. Then when your webservice gives you your updated information you find that marker in your array and update whatever you need. That way, whether the cell is on screen or not, your data source will be updated. If it is offscreen then the next time it comes onscreen the code will call cellForRowAtIndexPath and your data source will pass the updated information to it.

    Long story short, your data source is the only place where all of the data can be found and the OS does not release it to conserve memory.

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

Sidebar

Related Questions

have written this little class, which generates a UUID every time an object of
I have a UITableView that updates from a NSFetchedResultsController . The UITableView has alternating
In my app I have a tableview, with a custom tableviewcell and that has
Have an app that can use tts to read text messages. It can also
Have a Facebook app that is failing as of this morning with the following
Have 2 tables for example: In 1st: object & parent columns object | parent
previously i had custom tableviewcell and was loading from Nib.in that i have specified
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
Have not done this before, so obviously I suck at it. Here 64 pixels

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.