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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:29:10+00:00 2026-06-16T23:29:10+00:00

Context: I have a tableview with custom cells. Each cell has a button to

  • 0

Context: I have a tableview with custom cells. Each cell has a button to download a resource. When a button is pressed all other buttons in the tableview should be disabled.

So my problem is that I can’t get a reference to all the rows on the tableview since it is lazy loading. So when I try to access the other rows it fails because it doesn’t have an object to add at the point where I start disabling the buttons.

Here is the code it may be more enlightening on my problem:

NSMutableArray *cells = [NSMutableArray array];
for (NSInteger i = 0; i < [mainTableView numberOfRowsInSection:1]; ++i) {
    WSVideoLibraryTableCell *addedCell = (WSVideoLibraryTableCell *)[mainTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:1]];
    NSLog(@"CELL ADDED: %@", addedCell);
    [cells addObject:addedCell];
}
if (stateEnabled) {
    for (WSVideoLibraryTableCell *cell in cells) {
        [[cell downloadButton] setEnabled:YES];
    }
}
else
{
    for (WSVideoLibraryTableCell *cell in cells) {
        [[cell downloadButton] setEnabled:NO];
    }
}

I tried adding some code that takes only the visible cells. NSArray *array = [mainTableView visibleCells] but then the problem is that the cells that weren’t visible will have the button enabled and something weird happens with the rows that where visible, they appear again and again on the tableView (Something to do with lazy loading and changing them?)

Thanks a lot for comments or suggestions!!

  • 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-16T23:29:12+00:00Added an answer on June 16, 2026 at 11:29 pm

    My suggestion would be to have each object have its own isEnabled property, so that you can disable the objects themselves, and set a condition for the lazy loading to disable them according to that property.

    Lazy loading is very helpful, and while for a trivial number of cells you won’t notice a resource drain, you will as you increase the number of cells you’re processing.

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

Sidebar

Related Questions

I have a TableView with CoreData and Custom Cells which all works fine. now
In my tableview, I need a bunch (5-6 types) of different cells. All have
I just ran into to strange problem, I have a custom tableview cell with
I have TextField in Custom Cell of UITableview .my Tableview is lower part of
I have a problem with my custom cells. My cell is structured like this
So, I have a custom cell and I need to draw all images as
I currently have a tableview with youtube videos embedded inside of the custom cells.
I have custom cell in my tableview. when uitable view is in the editing
I have a static tableView with some custom cells. What I wan't to do
I´m using custom cells in a TableView. The cell height is calculated based on

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.