Using + [MagicalRecord saveWithBlock: termination:], termination is not called

When I call saveWithBlock:completion:, it actually saves the data, but does not call the completion block. Is there an error, or am I using this method incorrectly?

I am using MagicalRecord 2.2 from CocoaPods. I tried to downgrade to 2.1 with no luck - the problem remains.

[MagicalRecord setupCoreDataStackWithInMemoryStore];
[MagicalRecord setDefaultModelNamed:@"Model.momd"];

[MagicalRecord saveWithBlock:^(NSManagedObjectContext *localContext) {
    TestUser *test = [TestUser MR_createInContext:localContext];
    test.name = @"Lweek";
} completion:^(BOOL success, NSError *error) {
    NSLog(@"Yeah");
}];

It doesn’t output anything. The completion block does not start, although the data is saved properly.

+4
source share

Source: https://habr.com/ru/post/1538893/


All Articles