ERROR: Unrecognized attribute string flag '?' in attribute string "T@"NSString",?,R,C" for property debugDescription

Hello,

I'm seeing many errors like this in the Xcode debug console when I build and run my app:

ERROR: Unrecognized attribute string flag '?' in attribute string "T@"NSString",?,R,C" for property debugDescription

The app project makes heavy use of Logger(), and I suspect it is related to that logging in some way, but I haven't been able to narrow down the issue to specific log calls.

I have Category, Subsystem and Timestamp enabled in the Xcode console, but none of those are displayed for this output.

What causes this? Or how can I better narrow down the source?

Answered by drewster in 822245022

Thanks for the reply!

We fixed this two ways:

// debugDescription is... because Swift, I guess.
+ (MTLPropertyStorage)storageBehaviorForPropertyWithKey:(NSString *)propertyKey {
    if ([propertyKey isEqualToString:@"debugDescription"])
    {
        return MTLPropertyStorageNone;
    }
    else
    {
        return [super storageBehaviorForPropertyWithKey:propertyKey];
    }
}

@end

In our base model type:

+ (MTLPropertyStorage)storageBehaviorForPropertyWithKey:(NSString *)propertyKey {
    if ([@[
           @"isSubmitting", @"submitting", @"debugDescription"
           ] containsObject:propertyKey])
    {
        return MTLPropertyStorageNone;
    }
    else
    {
        return [super storageBehaviorForPropertyWithKey:propertyKey];
    }
}

@end

Oh, there is also an fpritntf that actually generates this output in MTLEXTRuntimeExtensions.m, starting at line 601. You can comment that out or delete it and change it to a "break;" statement, like this:

Hi drewster, did you find a solution for this? I'm seeing it too. Thanks

I'm seeing the exact same message in Xcode's console pane while parsing JSON into custom data objects using the open source library Mantle (version 2.1.6 using CocoaPods).

This is an iOS MapKit app showing whale-sighting annotations. Each sighting JSON has latitude, longitude, and other numeric and text values, all represented as strings.

This started happening with Xcode 15; the same code showed no such errors in Xcode 13 and Xcode 14.

Accepted Answer

Thanks for the reply!

We fixed this two ways:

// debugDescription is... because Swift, I guess.
+ (MTLPropertyStorage)storageBehaviorForPropertyWithKey:(NSString *)propertyKey {
    if ([propertyKey isEqualToString:@"debugDescription"])
    {
        return MTLPropertyStorageNone;
    }
    else
    {
        return [super storageBehaviorForPropertyWithKey:propertyKey];
    }
}

@end

In our base model type:

+ (MTLPropertyStorage)storageBehaviorForPropertyWithKey:(NSString *)propertyKey {
    if ([@[
           @"isSubmitting", @"submitting", @"debugDescription"
           ] containsObject:propertyKey])
    {
        return MTLPropertyStorageNone;
    }
    else
    {
        return [super storageBehaviorForPropertyWithKey:propertyKey];
    }
}

@end

Oh, there is also an fpritntf that actually generates this output in MTLEXTRuntimeExtensions.m, starting at line 601. You can comment that out or delete it and change it to a "break;" statement, like this:

ERROR: Unrecognized attribute string flag '?' in attribute string "T@"NSString",?,R,C" for property debugDescription
 
 
Q