Skip to content

Instantly share code, notes, and snippets.

@jaehess
Created November 8, 2010 23:13
Show Gist options
  • Select an option

  • Save jaehess/668452 to your computer and use it in GitHub Desktop.

Select an option

Save jaehess/668452 to your computer and use it in GitHub Desktop.
/* in main */
MyApp.userDefaults.defaults({
"MyApp:searches": [
{'query': 'Foo', 'count': 99}
,{'query': 'Bar', 'count': 0}
]
}
});
/* Array Controller */
MyApp.searchController = SC.ArrayController.create({
contentBinding: SC.Binding.oneWay(MyApp.userDefaults.getPath('MyApp:searches'))
});
/* in the list view */
,contentBinding: "MyApp.searchController.arrangedObjects"
,contentValueKey: "query"
,contentUnreadCountKey: "count"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment