The subclass of NSIncrementalStore causes infinite recursion after iOS upgrade

Number:rdar://123453467 Date Originated:15 August, 2019
Status:New Resolved:
Product:Core Data Product Version:iOS 13 beta 6
Classification:Bug Reproducible:YES
When calling metadataForPersistentStoreOfType:URL:error: to get metadata for custom NSIncrementalStore, the method causes an infinite loop.

Inside subclass of NSIncrementalStore I have code like this:

- (BOOL)loadMetadata:(NSError *__autoreleasing *)error {
    NSURL *storeURL = [self URL];

    NSDictionary *metadata = @{NSStoreUUIDKey: <UUID>,
                               NSStoreTypeKey: @"MyIncrementalStore"};
    [self setMetadata:metadata];

    return YES;

It seems that setMetadata: method calls loadMetadata: and it creates an infinite recursion(see screenshots).

I've noticed it only after upgrade from iOS 13 beta 4 to iOS beta 6. The bug isn't reproducible on older iOS versions and on freshly installed apps.

Appleā€™s documentation also suggests the same approach at


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!