Skip to content

Instantly share code, notes, and snippets.

@arbarlow
Created February 28, 2011 10:57
Show Gist options
  • Save arbarlow/847184 to your computer and use it in GitHub Desktop.
Save arbarlow/847184 to your computer and use it in GitHub Desktop.
@implementation ResortVenueViewController
@synthesize venue, venueID, managedObjectContext, locationOrPhotos;
- (void)viewDidLoad {
[super viewDidLoad];
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
NSEntityDescription *entity =
[NSEntityDescription entityForName:@"Venue"
inManagedObjectContext:managedObjectContext];
[request setEntity:entity];
NSPredicate *predicate =
[NSPredicate predicateWithFormat:@"remoteId == %@", venueID];
[request setPredicate:predicate];
NSError *error = nil;
NSArray *array = [managedObjectContext executeFetchRequest:request error:&error];
if (array != nil) {
if ([array count] != 0) {
venue = [array lastObject];
}
}
self.title = venue.name;
[self checkForFavourite];
[self setBackButtonTitle];
[self addSegmentedControl];
[self addVenuePhoto];
[self addLabelAndPlace];
}
- (void)viewDidAppear:(BOOL)animated{..}
- (void)checkForFavourite{..}
- (void)addLabelAndPlace{..}
- (void)addVenuePhoto{..}
- (void)addSegmentedControl{..}
- (void)didTouchSegment:(id)sender{..}
- (void)setBackButtonTitle{..}
- (void)addAsFavourite{..}
- (void)removeAsFavourite{..}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{..}
- (void)didReceiveMemoryWarning{..}
- (void)viewDidUnload{..}
- (void)dealloc{..}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment