Search code examples
iosobjective-cios6nsdictionary

IOS NSDictionary Issue


i have a NSDictonary looks like

{
    nowShowing =     (
        {
            programmeName = xx;
        },
        {
            programmeName = xx;
        },
        {
            programmeName = xx;
        }
    );
    programmeCategory =     (
        {
            imageUrl = "xx";
            programmeDescription = "xx";
            programmeName = xx;
        },
        {
            imageUrl = "xx";
            programmeDescription = "xx";
            programmeName = "xx";
        },
        {
            imageUrl = "xx";
            programmeDescription = "xx";
            programmeName = "xx";
        }
    );
    slideShowImages =     (
        {
            imageLink = "xx";
        },
        {
            imageLink = "xx";
        },
        {
            imageLink = "xx";
        },
        {
            imageLink = "xx";
        }
    );
}

I want to get these 3 variables (nowshowing , slideShowImages , programmecategory) separate inside my program is there a way can any body tell me how to do this, i am new to IOS development i dont know how to do this thank you


Solution

  • You may get it by using:

    NSArray *nowShowing = [dictionary objectForKey:@"nowShowing"];
    
    NSArray *programmeCategory = [dictionary objectForKey:@"programmeCategory"];
    
    NSArray *slideShowImages = [dictionary objectForKey:@"slideShowImages"];