tags:

views:

55

answers:

2

Help me in reading this dictionary: (its an NSDictionary generated from XMLData)

Menus = {

    Table1 = {
        Phone = {
            text = "\n    (404) 371-1466";
        };

        text = "\n  ";
    };
        text = "\n";
    };
}
A: 

You have one item in the dictionary - "Menus".

That single item is a dictionary, with two items - "Table 1" and "text". "Table 1" is a dictionary, "text" is an NSString.

Inside "Table 1", you have two items - "Phone" and "text". At this point, I think you can see the pattern...

Kendall Helmstetter Gelner
That I can figure out too, I have never used NSDictionary before..so my question is how to access those items?
Abhi
+1  A: 

This should get you the phone number, for example:

NSString *phoneNum = [[[[dict objectForKey:@"Menus"] objectForKey:@"Table1"] 
                         objectForKey:@"Phone"] objectForKey:@"text"];
JosephH
Thank You..it help.
Abhi