iOS - 将字典作为参数从 AFNetworking GET 传递时出现问题

iOS - Issue with passing Dictionary as parameter from AFNetworking GET

我正在尝试将从使用 AFNetworkingGET 请求收到的字典传递给 class method parameter。但是我收到了这个错误。

+[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.

您的 class SASwipeButtonSettings 似乎没有实现采用 NSDictionary* 的静态方法 performActionForLeftSwipeWithVideo。这似乎不是 AFNetworking 问题。