gpt4 book ai didi

objective-c - NSObject(NSObject)didNotRecognizeSelector:崩溃

转载 作者:行者123 更新时间:2023-12-03 16:46:48 26 4
gpt4 key购买 nike

崩溃报告:

    0  CoreFoundation!__exceptionPreprocess + 0x7c
1 libobjc.A.dylib!objc_exception_throw + 0x34
2 CoreFoundation!-[NSObject(NSObject) doesNotRecognizeSelector:] + 0xd0
3 CoreFoundation!___forwarding___ + 0x364[enter image description here][1]
4 CoreFoundation!_CF_forwarding_prep_0 + 0x58
5 yyfe!__70-[InvestModel getOpenAccountRewardWithPhoneNum:identifyCode:complete:]_block_invoke [InvestModel.m : 104 + 0x4]
6 libdispatch.dylib!_dispatch_call_block_and_release + 0x14
7 libdispatch.dylib!_dispatch_client_callout + 0xc
8 libdispatch.dylib!_dispatch_main_queue_callback_4CF + 0x730
9 CoreFoundation!__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 0x8

我的代码:
    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);

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

最佳答案

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

关于objective-c - NSObject(NSObject)didNotRecognizeSelector:崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34649275/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com