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
Post a Comment