简体   繁体   English

'NSInvalidArgumentException',原因:'-[__ NSCFString objectAtIndex:]:无法识别的选择器已发送到实例

[英]'NSInvalidArgumentException', reason: '-[__NSCFString objectAtIndex:]: unrecognized selector sent to instance

Below is my code 下面是我的代码

   nameLabel.text=[[[dict_Details objectForKey:@"unknown_object"] objectAtIndex:0] objectForKey:@"UserFullName"];

here is my response 这是我的回应

getUserReviewsResponse getUserReviewsResponse

{
"status_code" = 200;
"unknown_object" = "[{ID:227,ServiceProviderName:Dr.KarthikMendi,UserFullName:karthik,ReviewTemplateID:19,TotalScore:88.0,ServiceName:Doctor,Review:Very knowlegable doctor he understands the problem very well.,ServiceID:5,CommentsBySP:Thank you...,ServiceProviderID:0,CommentByAdmin:null,UserID:106,Status:true,CreatedDate:2016-05-06T18:30:08,Services:null,ServiceProviderTypes:null},{ID:168,ServiceProviderName:Dr.KarthikMendi,UserFullName:karthik,ReviewTemplateID:19,TotalScore:92.0,ServiceName:Doctor,Review:I am very impressed.  Very organized and professional.\\r\\nI always leave feeling taken care of and medical needs met. \\r\\nNeed more Dr\U00e2\U0080\U0099s like him!\\r\\nGreat!  He gave me sufficient time!\\r\\nVery friendly, informed and hospitable. \\r\\nVery nice \U00e2\U0080\U0093 didn\U00e2\U0080\U0099t feel like a number, but an actual person.,ServiceID:5,CommentsBySP:Thank you,ServiceProviderID:0,CommentByAdmin:null,UserID:84,Status:true,CreatedDate:2016-03-23T10:12:19.087,Services:null,ServiceProviderTypes:null}]";
}

The value for "unknown_object" is a string, but you are assuming it's a dictionary as you are calling objectForKey: on it. "unknown_object"的值是一个字符串,但是您在调用objectForKey:时假定它是字典。 Hence the exception. 因此,例外。

In general I would say that JSON is "broken" as it requires double-deserialization, which is less than useful. 总的来说,我会说JSON被“破坏”了,因为它需要双重反序列化,这没有用。

Please check your json data in http://jsoneditoronline.org/ correct or not. 请检查http://jsoneditoronline.org/中的json数据是否正确。

For example: Dr.KarthikMendi is string that include "Dr.KarthikMendi" (Double or single Quotation ). 例如:Dr.KarthikMendi是包含“ Dr.KarthikMendi”(双引号或单引号)的字符串。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 'NSInvalidArgumentException',原因:'-[__ NSCFString encodeString:]:无法识别的选择器已发送到实例 - 'NSInvalidArgumentException', reason: '-[__NSCFString encodeString:]: unrecognized selector sent to instance 终止应用程序-'NSInvalidArgumentException',原因:'-[NSCFString objectForKey:]:无法识别的选择器已发送到实例 - Terminating app - 'NSInvalidArgumentException', reason: '-[NSCFString objectForKey:]: unrecognized selector sent to instance UIPickerView NSInvalidArgumentException',原因:“-[__ NSCFString超级视图]:无法识别的选择器已发送到实例 - UIPickerView NSInvalidArgumentException', reason: '-[__NSCFString superview]: unrecognized selector sent to instance [__NSCFString objectAtIndex:]:无法识别的选择器已发送到实例 - [__NSCFString objectAtIndex:]: unrecognized selector sent to instance NSInvalidArgumentException - [__ NSCFString unsignedLongLongValue]:发送到实例的无法识别的选择器 - NSInvalidArgumentException -[__NSCFString unsignedLongLongValue]: unrecognized selector sent to instance 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:-[__ NSCFString方案]:无法识别的选择器已发送到实例 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: -[__NSCFString scheme]: unrecognized selector sent to instance 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[__ NSCFString size]:无法识别的选择器已发送到实例 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString size]: unrecognized selector sent to instance 'NSInvalidArgumentException',原因:'-[__NSCFString allKeys]:无法识别的选择器发送到实例 0x7ae2f750' - 'NSInvalidArgumentException', reason: '-[__NSCFString allKeys]: unrecognized selector sent to instance 0x7ae2f750' iOS:“ NSInvalidArgumentException”,原因:“-[__ NSCFString sortedArrayUsingFunction:context:]:无法识别的选择器已发送到实例。 - iOS: 'NSInvalidArgumentException', reason: '-[__NSCFString sortedArrayUsingFunction:context:]: unrecognized selector sent to instance. NSInvalidArgumentException',原因:' - [__ NSCFString isFileURL]:无法识别的选择器发送到实例0x712e450' - NSInvalidArgumentException', reason: '-[__NSCFString isFileURL]: unrecognized selector sent to instance 0x712e450'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM