- (void)addTask
{
   Task *task = [NSEntityDescription insertNewObjectForEntityForName:@"Task"
      inManagedObjectContext:[person managedObjectContext]];
   task.name = [NSString stringWithFormat:@"Zadanie %i", [person.tasks count] + 1];
   task.isDone = [NSNumber numberWithBool:NO];

   [person addTasksObject:task];

   NSError *error = nil;
   if (![[person managedObjectContext] save:&error]) {
      NSLog(@"Wystąpił błąd %@, %@", error, [error userInfo]);
   } else {
   }
}
