I'm trying to implement pull-to-refresh for my UITableView in iOS. The implementation is nearly done except that I can't properly perform the action that will take place for the refresh operation.
[self.refreshControl addTarget:self
action:(SEL)[self performSelector:@selector(fetchPhotoListWith:Using:)
withObject:@"https://api.instagram.com/v1/users/self/feed?access_token="
withObject:@"<my Instagram ID>"]
forControlEvents:UIControlEventValueChanged];
The above code(initiated in viewDidLoad
) gives the following error:
Cast of an Objective-C pointer to 'SEL' is disallowed with ARC
If I remove the (SEL)
casting in the front, this time I get the following error:
Implicit conversion of an Objective-C pointer to 'SEL' is disallowed with ARC
with another warning:
Incompatible pointer types sending 'id' to parameter f type 'SEL'
How can I play nice with ARC while being able to call my method with two arguments?