在iPad应用程序中保护plist [英] protecting plist in ipad app

查看:123
本文介绍了在iPad应用程序中保护plist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我正在将服务URL及其用户/密码保存在当前documents目录的plist中.我想将用户名和密码移到钥匙串上,并保护plist文件. 我尝试使用此示例中提供的keychainwrapper类,但无法确定如何向其中添加项目.

In my app I am saving service urls and their user/passwords in a plist in the documents directory currently. I want to move the user and passwords over to keychain and protect the plist files aswell. I tried using the keychainwrapper class given in this example, but couldn't figure out how to add items to it.

如何在钥匙串中添加包含用户名和密码的词典数组,并同时保护我的plist文件?

how do i add an array of dictionaries containing user name and passwords into keychain, and protect my plist files aswell?

推荐答案

如果要使用钥匙串,最好的解决方案是使用第三方库(

If you want to use keychain, best solution is using third party library(STKeychain). It is very simple to use it.

如果要将数组存储到钥匙串中,您可以执行的操作是将数组转换为序列化的字符串,然后将该字符串存储到一个钥匙串中.或者,您也可以根据需要将字典存储到多个钥匙串中.

If you want to store array to keychain, what you can do is you can convert array to serialised string and store that string to one keychain. Or you can store dictionaries to several keychain if you like.

我不明白您为什么仍要保护自己的plist?钥匙串就足够了,不需要再存储它了!

I don't understand why you still want to protect your plist? Keychain is enough, don't need to store it to plist anymore!

这篇关于在iPad应用程序中保护plist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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