如何保护我的应用程序的某些部分免受某些用户的攻击(即某些用户只能看到其中一个选项卡式视图)

时间:2012-08-12 22:59:15

标签: iphone objective-c ios ipad ios5

我正在构建我的第一个iOS应用程序(除了样本等),我将尝试放在应用程序商店。我会为iPhone / ipad制作这个并使用iOS 5.0。

我在想我的应用程序有标签视图。我将拥有一个基本用户和一个“成员”用户。成员用户可以访问基本用户没有访问的功能/视图/数据。我正在寻找两件事。一,关于保护/隐藏基本用户的最佳方法的一些想法和一些技术代码也有助于如何做到这一点。我有一个想法,我可能有一个所有成员都知道的密码,甚至做一个id /密码,我把这些信息放在一个plist或者什么东西然后我可以在viewdidload(也许?)导致一个模态视图在让他们看到视图/数据之前出现并挑战该人。

寻找任何想法。

2 个答案:

答案 0 :(得分:2)

我不建议使用预设密码方法。您几乎可以立即找到留言板上发布的用户名和密码。您将需要使用Web服务进行身份验证,或者将其作为应用内购买。

答案 1 :(得分:1)

实现此委托方法,然后使用逻辑来决定是返回YES还是NO:

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
Parameters
tabBarController
The tab bar controller containing viewController.
viewController
The view controller belonging to the tab that was tapped by the user.
Return Value
YES if the view controller’s tab should be selected or NO if the current tab should remain active.

Discussion
The tab bar controller calls this method in response to the user tapping a tab bar item. You can use this method to dynamically decide whether a given tab should be made the active tab.