大丈夫に応答しない、私は-Cをobjと新しいです知っているが、それは動作するはずのようにすべての意図や目的のために下に次のようだ:NSMutableArrayのはobjectAtIndexセレクタ
songCollection = [[NSMutableArray alloc] init];
[songCollection addObject:@"test"];
//Array is init, and I can see it in the debugger.
songCollection = [GeneralFunctions getJSONAsArray:@"library"];
// I can see the expected data in the debugger after this.
[songCollection retain];
NSLog(@"%@", [songCollection objectAtIndex:0]);
// Crashes here due to the array not responding to the selector. Also, the array is now empty.
//NSLog(@"%@", songCollection);
NSArray * songList = [songCollection objectAtIndex:1];
NSLog(@"%@", songList);
私は誰かができます願っています私をここに助けて、私は壁に頭を叩いている!
とNSMutableArrayのにNSArrayのを変換することができ、あなたが把握と仮定:[GeneralFunctions getJSONAsArray:@ "library"]]配列を完全に置き換える代わりに、 getJSONAsArray:関数は配列ではないので、その行は失敗します。結果はまだNSMutableArrayです。 –
ここに問題がありますが、関数getJSONAsArrayにNSArrayを返すように指示していますが、デバッガはNSCFDictionaryオブジェクトを返します。 – WedTM
そして、以前の応答で私自身の質問に答えました。 Fro私が使用しているJSONライブラリは、できるだけディクショナリを返すことを知っていて、Arrayにフェイルバックするのに十分な知能があります。 グレー... ありがとうございました! – WedTM