2016-05-25 11 views
0

を送信し、ここに私のコード'NSInvalidArgumentException'、理由:「 - [__ NSCFString objectAtIndex:]:認識されていないセレクタは、インスタンスには、以下の

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

である私の応答である

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}]"; 
} 
+0

キー 'unknown_object'の値は、大きな文字列であり、辞書ではありません。 – vadian

+0

それから今何をすべきですか? –

+1

JSON(JSON in String内のJSON)の場合、興味があるかもしれません:[Objective-CのJSON内でのJSONの解析]の可能な複製(http://stackoverflow.com/questions/33149110/parsing-json-within- json-in-objective-c) – Larme

答えて

0

してくださいhttp://jsoneditoronline.org/のjsonデータをチェックしてください。

例:Dr.KarthikMendiは「Dr.KarthikMendi」(ダブルまたはシングル引用)を含む文字列です。

1

"unknown_object"の値は文字列ですが、objectForKey:を呼び出すと辞書になっていると見なしています。したがって、例外。

一般に、私はJSONが二重直列化を必要とするため「壊れている」と言いますが、それは有用ではありません。

関連する問題