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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:57:40+00:00 2026-06-12T03:57:40+00:00

I am trying to load data into the application as the cells come into

  • 0

I am trying to load data into the application as the cells come into view so that once they press the cell’s accessory button it will have the data loaded.

My problem is that I am using AFNetworking and I am using this block code:

[Request fullRequestWithBlock:^(NSArray *detailedReqFromWeb, NSError *error) {
        if (error) {

            [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"OK", nil), nil] show];
        } else {

            NSArray *objs = [NSArray arrayWithObjects: [detailedReqFromWeb objectAtIndex: 0], [detailedReqFromWeb objectAtIndex: 1], [detailedReqFromWeb objectAtIndex: 2], [detailedReqFromWeb objectAtIndex: 3], [detailedReqFromWeb objectAtIndex: 4], [detailedReqFromWeb objectAtIndex: 5], nil];
            NSArray *keys = [NSArray arrayWithObjects:@"Risk", @"Destination", @"Source", @"Customer", @"Subcategory", @"Deployment", nil];

            NSMutableDictionary *detailsforRequestDictionary = [[NSMutableDictionary alloc] initWithObjects:objs forKeys:keys];

            [request addEntriesFromDictionary: detailsforRequestDictionary];

            NSLog(@"%@ Finished Loading", [idNumbers objectAtIndex:row]);
            cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;

        }

    } forID: [[idNumbers objectAtIndex:row] substringFromIndex:1]];

So basically, I am trying to change the accessory type from the indicator to the disclosure button once the data is loaded so then I can perform a segue to another view where the data that I loaded will be shown.

My problem is that it is changing the cell.accessoryType to the button before it has finished loading. The debug NSLog actually outputs when it actually finishes loading.

What is the best way to only enable the button when it’s done loading? I am guessing the request is not being processed by the main thread. How come I be notified that the request has finished processing so I can switch accessoryTypes?

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-12T03:57:41+00:00Added an answer on June 12, 2026 at 3:57 am

    Unless you do not recycle cells, you should never keep a cell reference around as the data it represents will change as the user scrolls. The right way is to dispatch a block on the main queue that updates a table entry in section/row coordinates. Your code then checks to see if that cell is visible, then updates it. It would also record status in some other fashion so that when the table scrolls the proper status is applied.

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

Sidebar

Related Questions

I'm trying to load some custom XML data into an Android application, so I
I was trying to load a data file into mysql table using LOAD DATA
I am trying to load some XML data into C++ code (classes) using gsoap.
Trying to load a small .txt file into mysql but get all my data
I'm trying to load and parse json data from an external source into a
I'm trying to load external SWF ( JW Player ) into my AIR Application
I am trying to load data asyncronously but on the first time, no progressbar
I'm facing a rather strange Issue when trying to load data from an XML-Webservice.
I have a table with composite primary key. I am trying to load data
I am trying to load mysql data from my database from a html select

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.