0

この関数は2か所でSIGTRAPを返します。

- (void)addShindy:(UIBarButtonItem *)sender
{
    AddShindyViewController *addShindyViewController = [[AddShindyViewController alloc] initWithNibName:@"AddShindyViewController" bundle:nil];
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addShindyViewController];

    addShindyViewController.delegate = self;

    NSManagedObjectContext *addingContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
    [addingContext setParentContext:[self.fetchedResultsController managedObjectContext]];
    // SIGTRAP occurring on line above this

    Shindy *shindy = (Shindy *)[NSEntityDescription insertNewObjectForEntityForName:@"Shindy" inManagedObjectContext:addingContext];
    addShindyViewController.shindy = shindy;
    addShindyViewController.managedObjectContext = addingContext;

    [self presentViewController:navController animated:YES completion:nil];
}

エラーをスローする2つの行には共通点があるため、エラーは「コンテキストの追加」に関係していると思われます。

誰かが私を必要とするならば、私はより多くのコードを投稿することができます。

4

0 に答える 0