Objective C - NSDictionary Question
Hi I am a newbie to objective C and was wondering how I could form an NSDictionary with the following structure.
level 1
level attribute 1.1 - level score - level percent level attribute 1.2 - level score - level percent level attribute 1.3 - level score - level percent level 开发者_如何学Python2 level attribute 2.1 - level score - level percent level attribute 2.2 - level score - level percent level attribute 2.3 - level score - level percent level 3 level attribute 3.1 - level score - level percent level attribute 3.2 - level score - level percent level attribute 3.3 - level score - level percentThanks in advance guys.
That's an NSDictionary with three keys ("level 1", "level 2" and "level 3"). Looks like each field of that dictionary contains an array that has three values, each of which is an NSDictionary with the level attribute, score, and percent.
The thing to remember is that NSDictionary isn't BY ITSELF a nested structure. It's just a set of key-value pairs. But it can contain other objects as values, including NSArrays and NSDictionaries.
精彩评论