我正在尝试将从使用AFNetworking
的GET
请求接收到的字典传递给类方法参数
。但是我收到了这个错误。
+[SASwipeButtonSettings performActionForLeftSwipeWithVideo:]: unrecognized selector sent to class 0x3a42a8
2015-06-29 15:03:38.526 StreamacyBeta[3712:1057453] *** Terminating app due to uncaught exception 'NSInvalidArgumentException'
这就是我检索和传递数据的方式。
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager GET:youtubeApi parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
self.videos = responseObject[@"items"];
[self.tableView reloadData];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
-(BOOL)swipeTableCell:(MGSwipeTableCell *)cell tappedButtonAtIndex:(NSInteger)index direction:(MGSwipeDirection)direction fromExpansion:(BOOL)fromExpansion
{
NSIndexPath *indexPath = [self.tableView indexPathForCell:(UITableViewCell *)cell];
NSDictionary *selectedVideo = self.videos[indexPath.row];
if (direction == MGSwipeDirectionLeftToRight) {
[SASwipeButtonSettings performActionForLeftSwipeWithVideo:selectedVideo];
}
return YES;
}
知道我为什么会遇到这个问题吗?我的方法中的参数只接受一个 NSDictionary
。
最佳答案
您的类 SASwipeButtonSettings
似乎没有实现采用 NSDictionary*
的静态方法 performActionForLeftSwipeWithVideo
。这似乎不是 AFNetworking 问题。
关于iOS - 将字典作为参数从 AFNetworking GET 传递的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31123617/