开发者

Is it possible to somehow save UIActionSheet indexes?

I would like to use an ActionSheet for sorting options in an app containing many table views with navigation controllers. My problem is that I cant seem to keep the last selected index on the sheet after poping back one level or quitting the app. The index value defaults back to 0 and I just cant seem to change its initial value. Its possibly something trivial 开发者_如何学编程but would really appreciate some help with it. Thanks.


Do you mean that you want the UIActionSheet on subsequent appearances to reflect the current setting?

If so, it may not be the correct UI metaphor to use, since it's just a series of buttons, and there is nothing to distinguish one button from another other than which one cancels an operation or is destructive, and neither of those seem to fit the "sort order" setting you want to keep track of.

What about trying a simple UITableView with a UITableViewCell that has an accessoryType of UITableViewCellAccessoryCheckmark? Like in Figure 1-3 here.


Read some tutorials or books on persistent storage. Core Data or SQLite are available for database needs, or you could store simple values in the NSUserDefaults. That should be enough to get you on your way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜