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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:17:24+00:00 2026-06-05T18:17:24+00:00

I have a delegate, but it doesn’t work without the other delegate line in

  • 0

I have a delegate, but it doesn’t work without the other delegate line in it:

- (id)initWithData:(NSData *)data delegate:(id <ParseOperationDelegate>)theDelegate {

    self = [super init];

    if (self != nil) {
        self.dataToParse = data;
        self.delegate = theDelegate;
    }

    appDelegate = (XMLAppDelegate *)[[UIApplication sharedApplication] delegate];

    return self;
}

It should load data in a Cell but the data isn’t shown before the first scroll. What can I do?

EDIT:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"productCell";
    static NSString *PlaceholderCellIdentifier = @"placeholderCell";

    int nodeCount = [appDelegate.products count];

    if (nodeCount == 0 && indexPath.row == 0) {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:PlaceholderCellIdentifier];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:PlaceholderCellIdentifier];
            cell.detailTextLabel.textAlignment = UITextAlignmentCenter;
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        }

        cell.detailTextLabel.text = @"Loading...";

        return cell;
    }

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }

    if (nodeCount > 0) {
        XMLProductView *listedProduct = [appDelegate.products objectAtIndex:indexPath.row];

        cell.textLabel.text = listedProduct.name;
        // cell.detailTextLabel.text = appRecord.artist;

        if (!listedProduct.productImage) {
            if (self.tableView.dragging == NO && self.tableView.decelerating == NO) {
                [self startImageDownload:listedProduct forIndexPath:indexPath];
            }
            UIImageView *listedImage = (UIImageView *)[cell viewWithTag:1];
            listedImage.image = [UIImage imageNamed:@"Placeholder.png"];
        }
        else {
            UIImageView *listedImage = (UIImageView *)[cell viewWithTag:1];
            listedImage.image = listedProduct.productImage;
        }

    }

    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-05T18:17:25+00:00Added an answer on June 5, 2026 at 6:17 pm

    your code seems that its waiting for some event, or some files to get fetched or downloaded, so you will need to call [tableview reloadData]; when this data is downloaded,

    I cant figure it out from the code, but my guts tells me this

    1st:
    that you are waiting for data from int nodeCount = [appDelegate.products count]; to be ready, so you will need to have some sort of delegate that gets called when this data is ready

    2nd:
    you are waiting for an image to get downloaded here [self startImageDownload:listedProduct forIndexPath:indexPath], so when this actually get downloaded you will need to set the image to that cell or reloadData on the table

    That is what i can figure out from the code.

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

Sidebar

Related Questions

i want to display an UIImage within a UIImageView but it doesn't work and
I have a class which has it's delegate: @protocol SNIRCControllerDelegate - (void) serverTalked:(id)data; @end
I have seen other posts on this subject, but no valid solutions. Surely this
Both are delegates and have the same signature, but I can not use Action
When i have delegate like public delegate void PrintMe(); (1) PrintMe a = delegate()
I have this delegate in C#. public delegate string ACSharpDelegate(string message); How would I
Can we have same delegate for two events ? which have same number of
let's say I have public delegate DataSet AutoCompleteDelegate( string filter, long rowOffset); can I
Eg. I have following delegate method I want to use as a callback function
Is it possible to implement Delegate methods for FileSystemWatcher? I have a delegate method

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.