NSObject(NSObject)doNotRecognizeSelector:崩溃

时间:2016-01-07 07:11:33

标签: objective-c crash block

崩溃报告:

    NSDictionary* data = returnDict[@"data"];
    NSInteger respStatus = [data[@"respStatus"] integerValue];

    if ([data[@"code"] isEqual: @(1)] && respStatus == 6) {
        [weakSelf saveSuccessGetOpenAccountReward];
        callback(YES,[data[@"rank"] integerValue],[data[@"amount"] integerValue],getRewardSuccess);
        return;
    }

我的代码:

    typedef void(^GetRewardCallBack)(BOOL,NSInteger,NSInteger,GetRewardMessageType);

和回调类型:

{{1}}
104行是callback(),returnDict有“rank”和“amount”的值,我不确定callback = nil是否崩溃,但回调不能等于nil,有什么想法吗?

1 个答案:

答案 0 :(得分:0)

搞清楚!服务器返回的data [@“rank”]既不是NSString也不是NSNumber。所以它无法识别@selector(integerValue)