IOS 5中有没有有序的字典集合? [英] Is there any ordered dictionary collection in IOS 5?

查看:498
本文介绍了IOS 5中有没有有序的字典集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我使用的表数据源从字典。这个字典包含超过20个元素。

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.

如何获取索引?

推荐答案

简短的答案?不。我知道的感觉,虽然,这导致我...

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.

基本的要点是它同时维护一个NSMutableArray和一个NSMutableDictionary,使用数组索引,和键的字典。非常简单,真的。

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.

这篇关于IOS 5中有没有有序的字典集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆