如何在 iPhone 應用程序上存儲多個帳戶的用戶登錄詳細信息(用戶、密碼) (How to store user Login details(user, pass) for multiple accounts on iPhone app)


問題描述

如何在 iPhone 應用程序上存儲多個帳戶的用戶登錄詳細信息(用戶、密碼) (How to store user Login details(user, pass) for multiple accounts on iPhone app)

我有一個要求用戶登錄(用戶名、密碼)的 iPhone 應用程序。我目前存儲上次成功登錄的憑據,並在用戶下次啟動應用程序時填寫文本字段。

很多時候,雖然用戶可能擁有多個帳戶,但我現在需要實現一些東西存儲更多帳戶的登錄憑據。

您如何建議我這樣做?我環顧四周,但找不到與此相關的任何內容。


參考解法

方法 1:

NSUserDefaults or Storing into sqllite or Storing into a plist are on of the ways of storing persistent data. But they are not secure. I will recommend Key Chain Access for storing secure data.

This link provides a apple sample code which uses key chain Access

http://developer.apple.com/library/ios/#samplecode/GenericKeychain/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007797‑Intro‑DontLinkElementID_2

But one disadvantage is you cant test this in simulator it works only on device i think.

You can also add multiple items to the keychain.

方法 2:

Look NSUserDefaults at the documentation.

Maybe this tuto can help you : http://icodeblog.com/2008/10/03/iphone‑programming‑tutorial‑savingretrieving‑data‑using‑nsuserdefaults/

方法 3:

Try with CoreData...

(by manosproiprabaMathieuFKingofBliss)

參考文件

  1. How to store user Login details(user, pass) for multiple accounts on iPhone app (CC BY‑SA 3.0/4.0)

#autosave #iphone #autologin #loginview






相關問題

保存 NSDocument 時收到通知 (Get notified when NSDocument is saved)

忽略差異中的Emacs自動生成的文件 (Ignore Emacs auto-generated files in a diff)

如何在 OSX 應用程序中恢復窗口位置? (How to restore window position in an OSX application?)

使用沒有保存按鈕的 Symfony 爬蟲發送表單(自動保存功能) (send form with Symfony crawler without save button (autosave function))

如何在 NumericTextbox Kendo UI 滾動條中觸發自動保存 (How to trigger autosave in a NumericTextbox Kendo UI Scrollbars)

自動保存草稿的最佳做法? (Best practices for autosaving drafts?)

如何在 iPhone 應用程序上存儲多個帳戶的用戶登錄詳細信息(用戶、密碼) (How to store user Login details(user, pass) for multiple accounts on iPhone app)

從 OSX lion 上的版本瀏覽器恢復不起作用...想法? (Restoring from versions browser on OSX lion not working... ideas?)

是否有visual studio自動保存配置設置? (Is there a visual studio automatic save configuration setting?)

用戶退出應用程序時在 MapKit 中存儲註釋 (Store annotations in MapKit when user quit application)

Umbraco 全部內容自動保存 (Umbraco Whole Content Autosaving)

是否有使用 MVC 架構(asp.net、c#、jquery、ajax)自動保存冗長 Web 表單數據的 API/解決方案 (Is there an API/ solution for Auto-saving data of lengthy web forms using MVC architecture (asp.net,c#,jquery,ajax))







留言討論