Is there any ordered dictionary collection in IOS 5?

半世苍凉 提交于 2019-12-24 09:14:57

问题


My issue is I am using the table data source from the dictionary. This dictionary contains more than 20 elements in it.

I need to search the element present in the dictionary and I need to scroll that element to a visible cell.

My issue is I found the element, but it is out of the visible area. I need to scroll that to a visible area.

How can I get the index?


回答1:


Short answer? Nope. I know the feeling though, which lead me to...

Longer answer? Yes-ish? My search a little while back brought me to this lovely little page. The guy provides a nice, neat little class for an ordered dictionary. I suggest reading the full article, it explains things nicely.

The basic gist is that it maintains both an NSMutableArray and an NSMutableDictionary at the same time, using the array for indices, and the dictionary for keys. Quite simple, really.



来源:https://stackoverflow.com/questions/10545785/is-there-any-ordered-dictionary-collection-in-ios-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!