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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:37:04+00:00 2026-06-04T01:37:04+00:00

I set. When last cell displayed , add cell by threadProcess. -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell

  • 0

I set. When last cell displayed , add cell by threadProcess.

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell      forRowAtIndexPath:(NSIndexPath *)indexPath
 {
    int nArrayCount;
    nArrayCount=[self.mAppGameList count];
    int row= (int)indexPath.row ;

    if(row == nArrayCount)
    {
        if(mSearchGame_Thread != nil)
            return;

        NextSearchCell *searchCell =(NextSearchCell *)cell;

        [searchCell.mActivityView startAnimating];

        NSThread *searchThread = [[NSThread alloc] initWithTarget:self
                                                         selector:@selector(searchNextThreadProc:) object:tableView];

        self.mSearchGame_Thread = searchThread;
        [searchThread release];
        [self.mSearchGame_Thread start];
        // start new search ...

    }

//thread method

  -(void)searchNextThreadProc:(id)param
 {

    UITableView *tableView=(id)param;

    NSMutableArray *newArray;

    newArray=[NSMutableArray arrayWithArray:self.mAppGameList];

    NSArray *pressedlist;
    nArrayCount=[self.mAppGameList count];

               .
               .
               .
   [newArray addObject:item];
   self.mAppGameList = newArray;

     [tableView reloadData];

     self.mSearchGame_Thread=nil;
 }

This way is problem.

  1. If I scroll table when tableview reload data, for a while tableview disappeared and appeard.

  2. If I touch cell while adding next cell , sometimes it occur bad exc memory .
    I think, it call tableView: didSelectRowAtIndexPath: method before reloading new table. so, table’s data is not.

So, I want to replace reload tableview way.Is there any way? please help me.

  • 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-04T01:37:06+00:00Added an answer on June 4, 2026 at 1:37 am

    Instead of using reloadData, you can add the new rows by animation using this method in UITableView:

    - (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
    

    That way your view will not dissappear and reappear when reloading.

    See this question: UITableView add cell Animation

    Also make sure to perform any refreshments of the UI in the main thread by using:

    [self performSelectorOnMainThread:@selector(refreshMethodName) withObject:nil waitUntilDone:NO];
    

    A few comments about your code:

    • Make sure that your mAppGameList is either a retain-property or a copy-property if used as above in your code. Otherwise that could cause bad access.
    • You should make sure searchNextThreadProc is not called several times at once, or you could get timing and performance issues. It does not look thread safe.
    • Typically you should handle content data a bit more separated from the UITableView. See the table view as a tool for displaying a list of data that is already in place. It should not have to worry about searching for data etc. Instead use a separate class that holds the data you are working with in an NSMutableArray, that you keep filling up with data when you need to. This class can be triggered to start searching for new data by the tableView through a method call, but make sure that the refreshment process is thread safe and sustainable to multiple calls from the UI! 10xrefresh calls at once still means only 1 refresh at a time! (we don’t want 10 simultaneous calls to a server for example) This content list should be completely separated from the UITableView’s list.
    • When new data is available, tell the UITableView to refresh by creating a refresh method that you can call. When refreshing the UITableView, if the mAppGameList property is retain or copy, no need to re-add all data in the list. If you have an NSMutableArray in a separate class containing all data as suggested, simply use something like self.mAppGameList = [NSArray arrayWithArray:[yourClass gameList]]; (if you are using retain for mAppGameList)
    • When triggering the refresh of the UITableView, use performSelectorOnMainThread. To start a new background thread you can also use performSelectorInBackground instead of NSThread alloc etc.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add a view after the last cell of tableview. I need
on my tableview i have the last cell that is not initially visible as
How do i set the textbox value to last day of last month(to end
can you get the last or newly added element in std::set? for example say
Possible Duplicate: Retrieving the last record in each group I have two tables set
I need this query - update last but one record. UPDATE changes SET checked=''
Set rs = conn.Execute(Statement) //rs has 6 fields I want to add the current
Although I have set hoverrows: false, a tooltip is being displayed when the mouse
Why does my app quit when user scrolls down the UITableView, past the first/last
i have a UITableViewCell, and i am trying to add an animation that causes

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.