iphone - Fetch NSarray from the NSDictionary of NSArray using objectForKey -


i have nsarray contain n number of nsdictionary samplearray =

 (             {             0 = 0;             1 = 0;         },             {             0 = 86400;             1 = 2;         },             {             0 = 172800;             1 = 4;         },             {             0 = 259200;             1 = 5;         }      ) 

now need fetch nsarray objectforkey 0 [samplearray objectforkey:[nsnumber numberwithint:0]], result nsarray should (0,86400,172800,259200) unable fetch result , app crashes.

normally nsdictionary, if key value set using nsstring valueforkey above operation performed if key value set using object nsnumber objectforkey unable perform operation.

please me solution, suggestion appreciated!!

a straight forward way if keys nsnumber objects:

nsmutablearray *result = [[nsmutablearray alloc] init]; (nsdictionary *d in a) {     if (d[@0]) {         [result addobject:d[@0]];     } } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -