好的,我知道我是 obj-c 的新手,但出于所有意图和目的,以下似乎应该可以工作:
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);
我希望有人可以在这里帮助我,我正在用头撞墙!