iPhone 密码集成
我想将密码集成到我现有的应用程序中。有谁知道有什么好的教程,或者可以帮助我进行搜索的教程吗?有标准的 Apple 教程来集成吗?我一直没能找到一个,但我想这就像在 didFinishLaunching & 中放置键盘视图一样简单。 quitActive 方法对吗?钥匙扣是存放它的好地方吗?再说一次,我不想在这方面重新发明轮子,特别是如果有一种经过验证的安全方法的话。这是我找到的一个很好的教程,但它没有包含视图或多个调用点。 http ://gorgando.com/blog/topics/technology/iphone_development/simple-iphone-tutorial-password-management-using-the-keychain-by-using-sfhfkeychainutils
谢谢!
I want to integrate a passcode into my existing application. Does anyone know of any good tutorials, or such that would lend to my search? Is there a standard Apple tutorial to integrate one? I've not been able to find one, but I imagine it'd be as simple as putting a keypad view in the didFinishLaunching & resignActive methods right? Would keychain be a good place to store it? Again, I'd hate to reinvent the wheel on this, especially if there is a proven secure method out there. Here is the one good tutorial I've been able to find, but it doesn't incorporate a view, or multiple invoke points. http://gorgando.com/blog/topics/technology/iphone_development/simple-iphone-tutorial-password-management-using-the-keychain-by-using-sfhfkeychainutils
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经经历过这个,但我没有任何与 Api 或您可以使用的东西的链接,但有一些建议:
- 对于多任务处理,您也应该在应用程序委托中的 comeActive 方法中调用密码视图,这样您的应用程序从后台返回时可能会提示输入密码。
基本上,您必须通过两种方法调用 de passcode:
第一个方法在进入后台之前调用,并且最好在进入后台之前调用以显示代码锁定视图,因为如果您在之后调用此方法,您可能应该看到在进入后台之前、在显示代码锁定视图之前,应用程序保持原样。
第二个,有点明显=D,但是你必须控制不要出现两次密码锁,因为当你从后台返回时也会调用第二个方法。
-与密码相关,它可以存储在一些自定义配置文件中,例如带有一点加密的plist。
- 与视图相关,您可以使用一些处理此类行为的协议创建自己的viewController。没什么大不了的。
希望这有帮助,再见
I've been through this, but I don't have any link with an Api or something you can use, but some advices:
-with multitasking you should call the passcode view in the becomeActive method in the app delegate too, the way that your app could prompt for a passcode when in returns from background.
basically you have to call de passcode in two methods:
the first one is called before going background, and it is better to call to present the code lock view before going to background than after, because if you call this after, you should probably see the application as you left it before going to background, before the code lock view is presented.
the second one, is kinda obvious =D, but you have to control not to present the code lock twice, because the second method is also called when you return from background.
-Related to the password, it can be stored in some custom configuration file, such us a plist with a little encryption.
-Related to the view, you can create your own viewController with some protocols that handles this kind of behavior. Not big deal.
Hope this helps, bye
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
如果您有任何保存方案,请将此放在特定的操作中,否则在第一次应用程序启动时设置此设置。
检查 appDelegate 放置适当的 if else 条件然后使用上面的代码
现在您可以访问此密码
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
if (标准用户默认值)
self.passCodeString = [standardUserDefaults objectForKey:@"lock"];
您可以在特定视图中使用它(用于密码)。
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
if you have any saving scheme then put this in particular action othervise set this at the first time application launch.
check in appDelegate put proper if else condition then use above code
Now you can access this passcode
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
if (standardUserDefaults)
self.passCodeString = [standardUserDefaults objectForKey:@"lock"];
And you can use this in a perticular view (for passcode).