이 오류는 무엇을 의미 할 수 있습니까?[__NSCFNumber 길이] : 인식 할 수없는 선택기가 인스턴스로 전송 됨 0x6d21350
[__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 블록으로 간다. 그리고 위의 에러로 죽는다.
아마도 메모리 관리에 문제가 있습니다. 런타임/프레임 워크는 더 이상 (조기 할당 해제에서) NSString을 기대하지 않고 NSNumber가 대신 할당되었습니다. 의도적으로 '길이'를 NSNumber에 보내려한다면, 컴파일러는 당신에게 경고 할 것입니다. – dreamlax
'NSNumber'가 사전에서 또는 유형을 지우는 다른 인터페이스를 통해 전달되는 경우가 아닙니다. 하지만 당신 말이 맞아요, 그가 뭔가를 과도하게 발표했을 가능성이 큽니다. 'NSZombieEnabled'로 시도하는 것이 좋습니다. – zoul
"유형을 지우다"는 것은 무엇을 의미합니까? – dreamlax