在iOS中解析JSON数组

tod*_*roa -2 json objective-c ios

我正在尝试从www.tiritium.com/standings.php上的php生成的文件中读取一个JSON数组,它在Android上运行得很好,但是我无法从文件中读取它.它打开它正确,但我无法将NSDictionary纳入NSArray.

 //parse out the json data
    NSError* error;
    NSDictionary* json = [NSJSONSerialization
                          JSONObjectWithData:responseData //1

                          options:kNilOptions
                          error:&error];

    NSArray* latestNames = [json objectForKey:@"name"]; //2

    NSLog(@"name: %@", latestNames); //3
Run Code Online (Sandbox Code Playgroud)

我把错误缩小到了// 2,但我似乎无法弄清楚发生了什么.我不确定我的数据是如何从脚本输出的,也不是我应用程序本身的代码输出.

2013-08-14 16:39:51.992 Derby Days[7951:c07] -[__NSCFArray objectForKey:]: unrecognized selector sent to instance 0x8a297b0
2013-08-14 16:39:51.993 Derby Days[7951:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray objectForKey:]: unrecognized selector sent to instance 0x8a297b0'
Run Code Online (Sandbox Code Playgroud)

是我收到的错误消息.

Kev*_*vin 7

阅读例外情况

-[__NSCFArray objectForKey:]: unrecognized selector
Run Code Online (Sandbox Code Playgroud)

JSON的根是一个数组,而不是字典.