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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:28:34+00:00 2026-06-16T09:28:34+00:00

I currently have a uitableview in place. The data is obtained from an sqlite

  • 0

I currently have a uitableview in place.

The data is obtained from an sqlite file.

Each column of the sqlite file will represent a list of: labels, images etc

The code i am using to get rows is

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
  AppDelegate* appdelegate = (AppDelegate*) [[UIApplication sharedApplication]delegate];
  return [appdelegate.arrayDatabase count];

}

The code to populate the cells

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

  static NSString *simpleTableIdentifier = @"simpleTableIdentifier";

  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
  if (cell == Nil)
  {
    cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:simpleTableIdentifier];
  }

  AppDelegate * appdelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
  ShowsList *sShows = [appdelegate.arrayDatabase objectAtIndex:indexPath.row];
  cell.textLabel.text = [sShows strName ];
}

The problem i am having:

I want to use the labels column to populate the cell text of ViewController1.tableview but it is returning the null rows and displaying empty rows/cells in the view.

However I want to hide the rows by either counting the null cells and applying the count to the numberOfRowsInSection: method or by simply hiding empty cells.

Hide empty cells in UITableView & How to hide a section in UITableView? looks like something similar but didn’t resolve my issue.

Could somebody please point me down the correct path or provide the answer 🙂

Thanks so much

Thomas

  • 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-16T09:28:35+00:00Added an answer on June 16, 2026 at 9:28 am

    just implement a reloadTableData method like that

    - (void)reloadTableData
    {
    // do a reload maybe from db and get yourobjects eg dbItems
    // _tableItems = [NSMutableArray array];
        for (ShowsList *list in dbItems) {
            if ([list strName].length) {
                [_tableItems addObject:list];
            } 
        } 
    }
    

    then just use _tableItems array to populate your tableview

    use [self reloadTableData] instead [self.tableview reloadData]

    -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    
      return _tableItems.count;
    
    }
    
    -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
    
      static NSString *simpleTableIdentifier = @"simpleTableIdentifier";
    
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
      if (cell == Nil)
      {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:simpleTableIdentifier];
      }
    
      ShowsList *sShows = [_tableItems objectAtIndex:indexPath.row];
      cell.textLabel.text = [sShows strName ];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have a UITableView with custom cells and in each cell there is
Currently I have a UITableview, I have enough data that cannot be shown entirely
Currently I have UITableView and simple UIView in my iPad application. Each of them
In my app I have UITableView & table data can be updated from remote
I am not able to delete data from SQlite database. I have created a
Currently I have a UITableView with its data source being an NSFetchedResultsController . The
Short Explanation Currently I have a UITableView which contains cells of videos from a
Currently have a drop down menu that is activated on a hover (from display:none
I have a UITableView in an app that I'm developing. I currently have it
I have a UITableView set up with a Core Data fetched results controller and

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.