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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:06:44+00:00 2026-05-28T19:06:44+00:00

Would you guyz be so kind to help me with such question: I have

  • 0

Would you guyz be so kind to help me with such question:
I have to fill the tableView with cells and I also have an array with objects to fill cells with.
The question is – how to skip creating a cell if the object doesn’t meet some conditions? I mean how to write something like:

- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if(objectIsOk) {
    //create cell
} 
else {
    //do nothing
}
return cell;

NOTE: I don’t have an access to that array of objects it gives me an object per indexPath.row dynamically

  • 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-05-28T19:06:46+00:00Added an answer on May 28, 2026 at 7:06 pm

    I’m unsure as to what you mean by “skip creating a cell”. Your table view data source is required to return a cell for each cellForRowAtIndexPath: call, which will get called for each row in each section that you have said the table will contain.

    If you want to return a blank cell then why not just do something like this:

    - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        UITableViewCell *cell = nil;
    
        if (objectIsOk) {
            // Create normal cell
        } else {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"BlankCell"];
        }
    
        return cell;
    }
    

    You could also return height of zero in the heightForRowAtIndexPath: delegate method to make it appear that it’s not there, like so:

    - (CGFloat)tableView:(UITableView *)aTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
        if (objectIsOk) {
            return 44.0f;
        } else {
            return 0.0f;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would the following SQL remove also the index - or does it have to
Would someone kindly assist me with the following? I have two DataGridView objects that
Would someone be able to help here? I would like to fill a div
would like to put fieldSets side-by-side on my Edit page because I have so
Would it be OK to have a single instance of SQLiteOpenHelper as a member
Would appreciate some assistance i have a txt file witht he following contents: 1234|dog|apartment|two
Would it be possible in SQL Server 2008 to have a table created with
Would the second autoload method I have below be better performance? <?php // regular
Would some be able to help me with some links on how FPA is
Would prefer an answer in C#, .Net 3.5 using WPF (Windows Forms also okay)

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.