I am using UIRefreshControl for pull down to refresh for iOS 6, it is working. I am using a custom delegate to update when it is done, in that method I call,
[self->refresh endRefreshing];
I have declared,
UIRefreshControl *refresh;
in the interface file, because I am not able to call
[self->refresh endRefreshing]
from by custom delegate method.
Its all working perfectly for iOS 6, but on lower version of iOS, it fails because `UIRefreshControl’ is only available from iOS 6 and above.
How can i conditionally declare them so that it works both on iOS6 and below?
id.UIRefreshControl *whenever you use it.if (NSClassFromString(@"UIRefreshControl") != Nil) { ... }to ensure thatUIRefreshControlis available.