Skip to content

Instantly share code, notes, and snippets.

@jfahrenkrug
Created September 8, 2009 14:07
Show Gist options
  • Save jfahrenkrug/182937 to your computer and use it in GitHub Desktop.
Save jfahrenkrug/182937 to your computer and use it in GitHub Desktop.
@import <Foundation/CPObject.j>
@import "Location.j"
@import "DemoData.j"
@import "LocationListView.j"
@implementation LocationsController : CPObject
{
CPArray locations;
LocationListView locationListView @accessors;
}
- (void)setLocations:(CPArray)someLocations {
locations = someLocations;
}
- (TripDay)locations {
return locations;
}
- (void)loadExampleLocations {
var json = [[DemoData exampleJSONString] objectFromJSON];
[self setLocations:[Location locationsFromJSONObjects:json]];
}
- (Location)selectedLocation {
return [locations objectAtIndex:[[locationListView selectionIndexes] firstIndex]];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment