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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:22:18+00:00 2026-06-14T03:22:18+00:00

I have a completely custom view that holds a UITableView and a Custom Tab

  • 0

I have a completely custom view that holds a UITableView and a Custom Tab Bar (basically a UIView that contains 6 UIButtons).

I am loading data from a plist file, and then I am sorting the data into multiple arrays based on categories (an array for misc items, and array for mail items, etc.)

Each button in the tab bar represents a category, and when I press the button I call the custom function “miscSelected” and so on.

How can I have the table view completely reload and then display the tableview based on the array selected (select the misc category and the tableview clears itself and loads the misc array data, same for any other category)?

The method I have experimented with is created and NSString named “selection” and then in each button function I set selected to equal whatever section I am selecting. In my cellForRoxAtIndexPath method I have this:

if ([self.selection isEqualToString:@"All Items"]) {
        NSArray *mainDataArray = [NSArray arrayWithContentsOfFile:self.plistFile];

        NSSortDescriptor *brandDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES];
        NSArray *sortDescriptors = [NSArray arrayWithObject:brandDescriptor];
        self.sortedData = [mainDataArray sortedArrayUsingDescriptors:sortDescriptors];

    }
    else if ([self.selection isEqualToString:@"Misc Items"]){

        self.sortedData = [NSArray arrayWithContentsOfFile:self.plistFile];


    }

    cell.itemTitle.text = [[self.sortedData objectAtIndex:indexPath.row] objectForKey:@"name"];

For the sake of example and testing I am simply displaying the same data, just one button displays it in alphabetical order and the other does not.

This code works only when I start to scroll down and back up, but it does not actually update on button press. Calling myTable reloadData does not do anything either.

Any help would be great, 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-14T03:22:20+00:00Added an answer on June 14, 2026 at 3:22 am

    So I spent quite some time looking even more and I found the solution. For anyone who may want to know, it was a small piece of code like this:

    [self.myTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
    

    Works perfectly now!

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

Sidebar

Related Questions

Basically, I have a UITabBar that contains a UITableView in each tab. The tables
I have a custom view controller that implements the from UITableViewDataSource and UITableViewDelegate protocols.
I have a custom view that has to track the user's location. I put
I have a UITabBarController that nests a UIView-Subclass (ImageViewer) as it's third tab. In
I am playing with custom view and routes. I think that I have everything
In my iPhone app I have implemented a custom tab bar which functions perfectly,
I have a completely empty RavenHQ database that's linked to my Appharbor application. The
I have a number of sites that are completely hosted on Amazon S3 but
I have an update program that is completely independent of my main application. I
I am completely confused - I have a website that renders perfectly in IE8

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.