iphone - Populating UITableView with Dictionary Data -
my situation:
i have nsdictionary object. keyed nsnumber. values custom objects.
i want put dictionary values uitableview. far can tell, uitableview requires source collection indexed when cellforrowatindexpath called, can use indexpath value.
problem when didselectrowatindexpath called, want object dictionary, don't have key. have indexpath.row.
my solution: create array of keys. use index of array key, , use key object out of dictionary.
my problem: seems kind of sloppy since routine task (populating uitableview , responding when touches cell). way it's designed work or there better way?
the problem dictionaries don't have order, while table view does. answers this question should give ideas alternative ways of handling this.
Comments
Post a Comment