Skip to content

Instantly share code, notes, and snippets.

@Alos
Created April 3, 2011 21:02
Show Gist options
  • Save Alos/900808 to your computer and use it in GitHub Desktop.
Save Alos/900808 to your computer and use it in GitHub Desktop.
AppDelegate.m
- (IBAction)addNewAlbum:(id)sender {
Album *newAlbum = [[Album alloc] init];
newAlbum.name= [newAlbumName stringValue];
newAlbum.releaseDate = [newAlbumReleaseDate dateValue];
NSManagedObjectContext *context = [self managedObjectContext];
[NSEntityDescription insertNewObjectForEntityForName:@"Album" inManagedObjectContext:context];
[self insertObject:newAlbum inAlbumArrayAtIndex:0];
[addAlbumWindow orderBack:self];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment