Question

What is the difference between these two NSArray outputs using NSLog?

//Use to get all values from within Dictionary
    NSArray * values = [self.dict allValues];

    //Title
    self.namesArray = [values valueForKey:@"Imade"];

gives the following which is broken up into the KEY values they are stored in:

Names : (
        (
        tttt,
        tgrtg,
        trgrtgrtgrtgrtg
    ),
        (
        fcxczxc,
        zcxzc,
        asad
    ),
        (
        sdedw,
        frfefr
    )
)

and

self.colorArray= [[NSArray alloc] initWithObjects: @"Red", @"Yellow", @"Green",
                  @"Blue", @"Purpole", nil];

gives

Names : (
    Red,
    Yellow,
    Green,
    Blue,
    Purpole
)

Now I can populate a uiTableViewCell with the colored NSArray however I cannot with the Names NSArray. Why is this and how do I fix it? Do I need to break the namesArray down further and how do I do this? Im sorry if this is obvious.

If needed

 //Use to get Key Values from within Dictionary
   self.sectionArray = [self.dict allKeys];

UPDATE:

enter image description here

Was it helpful?

Solution

It looks like the first array is an array of arrays, and the second one is an array of strings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top