-3
{
 id:1
 Vendors:
        {
          47:
             {
               items:{
                     }
               price:
                    {
                     this value I want
                    }
             }
          55:
            {
            }
  • in above code I wouldn't know which vendor id it is at what index. So I cannot use valueForKey. Can I get price array for both ids like:

    arrayPrice:{ { value1 } { value2 } }

or is there any way to get key at index. So that I can use valueForKey:@"47"

Avijit Nagare
  • 8,482
  • 7
  • 39
  • 68
Jashu
  • 1,061
  • 13
  • 19
  • Dictionaries don't have an order, so indexes don't make sense. Having said that your question doesn't make sense anyway. – trojanfoe Feb 03 '16 at 07:37
  • http://stackoverflow.com/questions/8268366/how-to-get-values-without-using-key-from-nsdictionary-nsmutabledictionary-in-iph check this – iAnurag Feb 03 '16 at 07:37

1 Answers1

2

You can use the property of NSDictionary allValues but you can't maintain the sequence because NSDictionary index according to keys. You have to use NSArray if order matters for you.

Fahri Azimov
  • 11,470
  • 2
  • 21
  • 29
Safwan Ahmed
  • 205
  • 2
  • 7