简体   繁体   English

iPhone应用程序设置

[英]iphone app settings

I would like to be able to show the app settings to some users and to others no. 我希望能够向某些用户显示应用程序设置,而对其他用户则不可以。 I have created the settings bundle (the default settings bundle outside the app), it works fine and I know how to access the settings value pragmatically. 我已经创建了设置捆绑包(应用程序外部的默认设置捆绑包),它可以正常工作,并且我知道如何实用地访问设置值。

What I would like to do is either: 我想做的是:

***if(user logged) do nothing else make settings disappear ***如果(用户已登录)不执行其他操作会使设置消失

or: ***if(user logged) create settings pragmatically and make them show else make settings disappear/delete 或:***如果(用户已登录)实用地创建设置并使其显示,否则设置将消失/删除

I know I can't make the whole settings invisible is it possible to make one of the pref invisible??? 我知道我无法使整个设置不可见,是否可以使其中一个首选不可见?

How could I do that? 我该怎么办?

A setting bundle is totally static. 设置包是完全静态的。 You can't run some code in it, like checking if the user is connected. 您无法在其中运行某些代码,例如检查用户是否已连接。 I pretty sure that you cannot, in your app, activate or deactivate the setting bundle. 我非常确定您无法在您的应用中激活或停用设置包。 If I'm wrong, I would be glad to know how. 如果我错了,我会很高兴知道如何做。

EDIT : 编辑:

You should create an in-app settings view controller to control dynamically some entries. 您应该创建一个应用内设置视图控制器,以动态控制某些条目。 There's no automated way to make that kind on settings but I think you should create an UITableViewController. 没有自动的方法可以进行这种设置,但是我认为您应该创建一个UITableViewController。 Here's the documentations : https://developer.apple.com/library/IOs/#documentation/UserExperience/Conceptual/TableView_iPhone/AboutTableViewsiPhone/AboutTableViewsiPhone.html#//apple_ref/doc/uid/TP40007451 这是文档: https : //developer.apple.com/library/IOs/#documentation/UserExperience/Conceptual/TableView_iPhone/AboutTableViewsiPhone/AboutTableViewsiPhone.html#//apple_ref/doc/uid/TP40007451

And a good sample code : https://developer.apple.com/library/IOs/#samplecode/TableViewSuite/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007318 还有一个很好的示例代码: https : //developer.apple.com/library/IOs/#samplecode/TableViewSuite/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007318

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM