こんにちは、Web サービスの json 文字列を作成しました。名前と説明を出力して NSLog に表示したいと考えています。どうやってやるの。これまでの私のコードは次のとおりです。
dic = [NSJSONSerialization JSONObjectWithData:result options:kNilOptions error:nil];
NSLog(@"Results %@",[NSString stringWithFormat:@"%@",[[dic objectForKey:@"d"]objectForKey:@"Name"]]);
私はこのエラーが発生します:
-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x6b50f30
辞書に NSLog を作成すると、次のようになります。
{
d = "{
\n \"Name\": \"Apple\",
\n \"Beschreibung\": \"Steve Jobs ist tot\"}";
}
私の json 文字列は、webservice から次のようになります。
string json = @"{
""Name"": ""Apple"",
""Beschreibung"": ""Steve Jobs ist tot""}";