iphone - How to parse a Dictionary according to its index? -


i have dictionary , want parse dictionary according index of keys inside dictionary.actually want switch different dictionaries per value of current variable mean want keep accessing object inside dictionary according index.

k = k+1; nsdictionary * checkbox = [step objectforkey:@"checkboxsingle"]; nsdictionary * first = [checkbox objectatindex:k]; 

thanks

here have couple of examples iterate through nsdictionary. using first example, can access arbitery values using array [checkbox allkeys];. not should using nsdictionary because order of stuff afaik can completley random. can sorting nsarray though if serve purpose.

also nsdictionary implements nsfastenumeration, means if want can do;

for (nsstring *currentkey in checkbox) {     nsdictionary *current = [checkbox objectforkey:currentkey]; } 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -