Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes when adding the SVPullToRefresh view to UITableView #41

Closed
jimit opened this issue Jul 12, 2012 · 9 comments
Closed

App crashes when adding the SVPullToRefresh view to UITableView #41

jimit opened this issue Jul 12, 2012 · 9 comments

Comments

@jimit
Copy link

jimit commented Jul 12, 2012

I followed the required steps to add the SVPullToRefreshView but it doesn't seems to work. I get following error.

-[UITableView addPullToRefreshWithActionHandler:]: unrecognized selector sent to instance

Any idea? Thanks

@samvermette
Copy link
Owner

@jimit are you importing SVPullToRefresh.h? Are you getting a compiler warning about addPullToRefreshWithActionHandler: ? I'm pretty sure you must be missing something. Have a look at the demo project to see what you might be doing wrong.

@jimit
Copy link
Author

jimit commented Jul 13, 2012

I have checked everything. I don't get any warnings. The app runs just fine but as soon as I get to that view controller the app crashes and I get the error mentioned above.

@samvermette
Copy link
Owner

@jimit can you show me the code you're using to setup SVPullToRefresh?

@jimit
Copy link
Author

jimit commented Jul 15, 2012

#import "JCoffeeListViewController.h"
#import "SVPullToRefresh.h"

@interface JCoffeeListViewController ()

@synthesize tableView = _tableView;

@implementation JCoffeeListViewController

  • (void)viewDidLoad
    {
    [super viewDidLoad];

    //Add the pull down to refresh view
    [self.tableView addPullToRefreshWithActionHandler:^{
    NSLog(@"It's working");
    }];

}

@jimit
Copy link
Author

jimit commented Jul 15, 2012

Corrected**

#import "JCoffeeListViewController.h"
#import "SVPullToRefresh.h"

@interface JCoffeeListViewController ()

@implementation JCoffeeListViewController

@synthesize tableView = _tableView;

(void)viewDidLoad
{
[super viewDidLoad];

//Add the pull down to refresh view
[self.tableView addPullToRefreshWithActionHandler:^{
NSLog(@"It's working");

}];

}

@samvermette
Copy link
Owner

@jimit jeez I really have no idea, your code looks fine. I'm really puzzled... Which version of iOS are you running this on? And just to be sure, the demo project does work for you?

@jimit
Copy link
Author

jimit commented Jul 16, 2012

I had the same feeling. I can't seems to find why its behaving like this.

I am running it on iOS 5.1.1 and the demo works for me. I will keep you posted as soon as I figure it out.

@yimingtang
Copy link
Contributor

I've got the same problem. However, I remove the original source files of SVPullToRefresh. When I copy&paste, I selected the "add to target" option in Xcode. Finally, that's works fine.

@jimit
Copy link
Author

jimit commented Jul 26, 2012

@krafttuc Thanks for the tip. Somehow I had my unit test as the selected target. It works for me.

@samvermette Thanks again.

@jimit jimit closed this as completed Jul 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants