Sephiroth87 / ODRefreshControl

A pull down to refresh control like the one in Apple's iOS6 Mail App
MIT License
2.15k stars 385 forks source link

referencing activityIndicatorViewStyle throws runtime exception #68

Closed Rayfleck closed 10 years ago

Rayfleck commented 10 years ago
ODRefreshControl *odrc = [ODRefreshControl setupRefreshForTableViewController:self withRefreshTarget:self action:@selector(dropViewDidBeginRefreshing:)]; 

odrc.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;

Running Xcode 5, iOS 6.0 in the sim: results in a runtime exception: 2014-03-07 13:42:23.455 ODRefreshControlDemo[30924:c07] *\ Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIRefreshControl setActivityIndicatorViewStyle:]: unrecognized selector sent to instance 0x8145680'

Sephiroth87 commented 10 years ago

Sounds like you're using some different fork than mine, since I didn't write that class method...

Also, judging by the exception, I believe is some kind of fork that gives you Apple's refresh control if you're on iOS6+, and theirs doesn't support setting the activityIndicatorViewStyle...

So you can either use the master branch, or check for which kind of object you got before using it...