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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:12:50+00:00 2026-06-12T17:12:50+00:00

I am trying to implement the UIRefreshControl in my application. I have an xib

  • 0

I am trying to implement the UIRefreshControl in my application. I have an xib file and I added a UITableViewController to the empty nib file and I set the refresh property to “enabled”. Also I have added code to the viewDidLoad and a custom refresh method. The problem is I have an error I can’t find any information on….in my viewDidLoad I get “Property ‘refreshControl‘ not found on object of type ViewController“

- (void)viewDidLoad{

[super viewDidLoad];

self.myTableView =
[[UITableView alloc] initWithFrame:self.view.bounds
                           style:UITableViewStyleGrouped];

self.myTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth |
                                  UIViewAutoresizingFlexibleHeight;

self.myTableView.delegate = self;
self.myTableView.dataSource = self;

[self.view addSubview:self.myTableView];

UIRefreshControl *refresh = [[UIRefreshControl alloc] init];

refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[refresh addTarget:self action:@selector(refreshView:) forControlEvents:UIControlEventValueChanged];

self.refreshControl = refresh;

}

-(void)refreshView:(UIRefreshControl *)refresh {

refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Refreshing data..."];

// custom refresh logic would be placed here...

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMM d, h:mm a"];
NSString *lastUpdated = [NSString stringWithFormat:@"Last updated on %@",
                                [formatter stringFromDate:[NSDate date]]];

refresh.attributedTitle = [[NSAttributedString alloc] initWithString:lastUpdated];
[refresh endRefreshing];

}

I have no idea why that property isn’t available….what am I missing?

Looks like I need to inherit from UITableViewController in my ViewController.h file. If I already have UITableView there how do I inherit from both? If I change my code from ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> to ViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> then I get an error:

    error: NSInternalInconsistencyException', 
    reason: '-[UITableViewController loadView] loaded the "ViewController_iPhone" nib but didn't get a UITableView.'
  • 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-12T17:12:50+00:00Added an answer on June 12, 2026 at 5:12 pm

    You can add UIRefreshControl as a subview to your UITableView.

    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
    [refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
    [self.myTableView addSubview:refreshControl];
    

    As per Dave’s comment, this may break in future version of iOS. So please be careful while using this and try to raise a bug report to apple regarding this.

    Update:
    A better approach is by adding UITableViewController as a ChildViewController of self and then adding tableViewController.tableView as the subview of self.view. You dont have to do any hack to make it work in this way.

    [self addChildViewController:tableViewController];
    [self.view addSubview:tableViewController.tableView];
    

    You can define the frame for tableView accordingly. Using this approach, UIRefreshControl should work in the same way as it works for UITableViewController.
    `

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

Sidebar

Related Questions

Trying to implement the following behavior on an iPad. I have a map-centric application
I'm trying to implement UIRefreshControl in a UIViewController. I can't use UITableViewController because the
Trying to implement a search similar to here .This searches properties based on city,locality,property
Trying to implement a modal window with CCLayer. My modal view layer is added
Trying to implement NSCopying for the first time, and I have a question about
I'm trying implement Data Annotation to my Linq to SQL objects. The .dbml file
I have this weird kind of error. I am trying implement basic Euclidean algorithm
Trying to implement what I thought was a simple concept. I have a user
When trying to implement a simple OpenGL application, I was surprised that while it
Am trying to implement a generic way for reading sections from a config file.

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.