iphone – [__NSCFNumber length]:无法识别的选择器发送到实例0x6d21350

iphone – [__NSCFNumber length]:无法识别的选择器发送到实例0x6d21350,第1张

概述这个错误是什么意思? [__NSCFNumber length]: unrecognized selector sent to instance 0x6d21350 这是我的代码: NSString *urlString = @"http://api.twitter.com/1/statuses/update.json"; NSURL *url = [NSURL URLWithString @H_404_6@ 这个错误是什么意思?

[__NSCFNumber length]: unrecognized selector sent to instance 0x6d21350

这是我的代码:

Nsstring *urlString = @"http://API.twitter.com/1/statuses/update.Json";    NSURL *url = [NSURL URLWithString:urlString];    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];    [params setobject:status forKey:@"status"];    [params setobject:replyToID forKey:@"in_reply_to_status_ID"];    [params setobject:@"1" forKey:@"include_entitIEs"];    // Build the request with our parameter    TWRequest *request = [[TWRequest alloc] initWithURL:url parameters:params requestMethod:TWRequestMethodPOST];    // Attach the account object to this request    [request setAccount:twitteraccount];    [request performRequestWithHandler:^(NSData *responseData,NShttpURLResponse *urlResponse,NSError *error) {        if (!responseData) {            // inspect the contents of error             NSLog(@"%@",[error localizedDescription]);            self.alert = [[UIAlertVIEw alloc] initWithTitle:@"http error" message:@"I Could not connect to the Twitter API." delegate:self cancelbuttonTitle:nil otherbuttonTitles:@"OK",nil];            [self.alert show];            [self.replyDelegate replyRequestSuccessful:NO];        }        else {            /*Nsstring *responseDataAsstring = [[Nsstring alloc] initWithData:responseData enCoding:NSUTF8StringEnCoding];             NSLog(responseDataAsstring);*/            NSError *error;            NSArray *replyResponse = [NSJsONSerialization JsONObjectWithData:responseData options:NSJsONReadingMutableLeaves error:&error];            if (!replyResponse) {                NSLog(@"%@",[error localizedDescription]);                self.alert = [[UIAlertVIEw alloc] initWithTitle:@"JsON error" message:@"I Could not parse the JsON response from the Twitter API." delegate:self cancelbuttonTitle:nil otherbuttonTitles:@"OK",nil];                [self.alert show];                [self.replyDelegate replyRequestSuccessful:NO];            }            else {                [self.replyDelegate replyRequestSuccessful:YES];            }        }    }];

我尝试了deBUGgin,一旦进入了performRequestWithHandler就死了。它去了else块并且死于上面的错误。

解决方法 这意味着您正在传递一个NSNumber,其中被调用的代码期望Nsstring或其他具有长度方法的对象。您可以告诉Xcode打破异常,以便您可以看到长度方法被调用的位置。 总结

以上是内存溢出为你收集整理的iphone – [__NSCFNumber length]:无法识别的选择器发送到实例0x6d21350全部内容,希望文章能够帮你解决iphone – [__NSCFNumber length]:无法识别的选择器发送到实例0x6d21350所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1073658.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-26
下一篇2022-05-26

发表评论

登录后才能评论

评论列表(0条)

    保存