为什么在我的应用中建立本地高分板是最好的? [英] What's the best why to do a local high scores board in my app?

查看:80
本文介绍了为什么在我的应用中建立本地高分板是最好的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用制作一个本地高分板,但到目前为止没有成功. 我在任何地方搜索了本地高分板代码,但没有找到. 为什么写这样的东西最好?

I'm trying to make a local high scores board for my app, but with no success till now. I searched anywhere for a local high score board code but didn't found any. What is the best why to write such a thing?

如果可以的话,请发布示例代码.

If you can please post example code.

谢谢.

推荐答案

假设数据集很小,一种非常简单的方法是将NSArray存储在NSUserDefaults中.

A very easy way, assuming the data set is small, would be to store an NSArray in the NSUserDefaults.

如果数据集更大,则可以使用CoreData甚至使用NSKeyedArchiver创建的文件.

If the data set is larger you could use CoreData or even just a file created with an NSKeyedArchiver.

这篇关于为什么在我的应用中建立本地高分板是最好的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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