Welcome, Guest
Username Password: Remember me

Any examples of creating an app preferences pane with STV?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Any examples of creating an app preferences pane with STV?

Any examples of creating an app preferences pane with STV? 1 year, 4 months ago #1

I'm curious if there's any sample code available that would show how to setup an app preferences pane - with switches, text fields, etc. - that saves selections to NSUserDefaults? I imagine it should be easy enough, but I'm still learning both Objective-C and STV and would like some actual code to look at. Thanks!

Re: Any examples of creating an app preferences pane with STV? 1 year, 4 months ago #2

You can easily do that using STV's key-binding method. For more on the key-binding method, please refer to:

1- The samples app (called "Overview App" in STV 2.0), under the "Key-Binding" tab.
2- The key-binding video tutorial: sensiblecocoa.com/video-tutorials/watch/...inding-tutorial.html

Now after you use key-binding, you need to save and load from NSUserDefaults.
1- To save: simply set the values of all your keys to keys of the same name in NSUserDefaults.
2- To load: load the keys from NSUserDefaults into the tableModel.modelKeyValues dictionary (again by setting its key values to the ones in NSUserDefaults), then call [tableModel.modeledTableView reloadBoundValues].

Please tell me if you need more help.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Any examples of creating an app preferences pane with STV? 1 year, 4 months ago #3

That worked perfectly. Thanks for the fantastic support!
  • Page:
  • 1
Time to create page: 1.38 seconds