如何创建首选项窗格?

时间:2023-01-23 07:17:42

How do I create a preference pane for my app on Mac. Also, how do I make a preferences section for my app in the iPhone?

如何在Mac上为我的应用程序创建首选项窗格。另外,如何在iPhone中为我的应用制作首选项部分?

4 个解决方案

#1


Your iPhone app needs a Settings bundle if you want to have your preferences in the system preferences.

如果您希望在系统首选项中拥有首选项,则您的iPhone应用程序需要设置包。

http://developer.apple.com/iphone/library/samplecode/AppPrefs/index.html

You can create your own preferences view in your app on either platform. This is done by creating a view controller or window controller like you would any other view controller/window controller and you can use NSUserDefaults to store/retrieve the information you obtain from your user.

您可以在任一平台上的应用中创建自己的首选项视图。这是通过像创建任何其他视图控制器/窗口控制器一样创建视图控制器或窗口控制器来完成的,您可以使用NSUserDefaults来存储/检索从用户获得的信息。

#2


To put settings inside your application you might want to consider mySettings, an open source (EPL) framework for doing much of the hard work. After making a small code contribution myself I decided against including the setting inside my app after all.

要在您的应用程序中放置设置,您可能需要考虑mySettings,这是一个用于完成大部分艰苦工作的开源(EPL)框架。在自己做了一个小代码贡献后,我决定不再在我的应用程序中包含该设置。

#3


For the Mac, you may wish to consult Apple's Preference Panes guide.

对于Mac,您可以查阅Apple的Preference Panes指南。

#4


For Mac OS X, i would recommend my RHPreferences framework.

对于Mac OS X,我会推荐我的RHPreferences框架。

Available on GitHub. BSD Licensed.

可在GitHub上获得。 BSD许可。

Its a simple and easy Preferences window controller with multiple tabs for your next Mac application.

它是一个简单易用的首选项窗口控制器,具有多个选项卡,可用于下一个Mac应

It also provides:

它还提供:

  • Auto resizing between different sized tab views (With animation)
  • 在不同大小的选项卡视图之间自动调整大小(带动画)

  • Custom NSToolbarItem support
  • 自定义NSToolbarItem支持

  • Persistence of the last used tab
  • 最后使用的选项卡的持久性

  • Support for placeholder NSToolbarItems (eg NSToolbarFlexibleSpaceItemIdentifier & NSToolbarShowFontsItemIdentifier)
  • 支持占位符NSToolbarItems(例如NSToolbarFlexibleSpaceItemIdentifier和NSToolbarShowFontsItemIdentifier)

#1


Your iPhone app needs a Settings bundle if you want to have your preferences in the system preferences.

如果您希望在系统首选项中拥有首选项,则您的iPhone应用程序需要设置包。

http://developer.apple.com/iphone/library/samplecode/AppPrefs/index.html

You can create your own preferences view in your app on either platform. This is done by creating a view controller or window controller like you would any other view controller/window controller and you can use NSUserDefaults to store/retrieve the information you obtain from your user.

您可以在任一平台上的应用中创建自己的首选项视图。这是通过像创建任何其他视图控制器/窗口控制器一样创建视图控制器或窗口控制器来完成的,您可以使用NSUserDefaults来存储/检索从用户获得的信息。

#2


To put settings inside your application you might want to consider mySettings, an open source (EPL) framework for doing much of the hard work. After making a small code contribution myself I decided against including the setting inside my app after all.

要在您的应用程序中放置设置,您可能需要考虑mySettings,这是一个用于完成大部分艰苦工作的开源(EPL)框架。在自己做了一个小代码贡献后,我决定不再在我的应用程序中包含该设置。

#3


For the Mac, you may wish to consult Apple's Preference Panes guide.

对于Mac,您可以查阅Apple的Preference Panes指南。

#4


For Mac OS X, i would recommend my RHPreferences framework.

对于Mac OS X,我会推荐我的RHPreferences框架。

Available on GitHub. BSD Licensed.

可在GitHub上获得。 BSD许可。

Its a simple and easy Preferences window controller with multiple tabs for your next Mac application.

它是一个简单易用的首选项窗口控制器,具有多个选项卡,可用于下一个Mac应

It also provides:

它还提供:

  • Auto resizing between different sized tab views (With animation)
  • 在不同大小的选项卡视图之间自动调整大小(带动画)

  • Custom NSToolbarItem support
  • 自定义NSToolbarItem支持

  • Persistence of the last used tab
  • 最后使用的选项卡的持久性

  • Support for placeholder NSToolbarItems (eg NSToolbarFlexibleSpaceItemIdentifier & NSToolbarShowFontsItemIdentifier)
  • 支持占位符NSToolbarItems(例如NSToolbarFlexibleSpaceItemIdentifier和NSToolbarShowFontsItemIdentifier)