-[UTType conformsToType:] broken in iOS15?

Consider these 3 lines:

BOOL conform = [UTTypeJPEG conformsToType:UTTypeJPEG];
BOOL conform2 = [UTTypeJPEG conformsToType:UTTypeImage];
BOOL conform3 = [UTTypePNG conformsToType:UTTypeImage];

In iOS15 running in the simulator, surprisingly for me, they are not all YES, the last 2 are NO.

Apple has deprecated the previous kTypeXXX types in iOS14, so I'm trying to fix those deprecations, but I cannot get it to work in iOS15.

Is this not working or am I doing something wrong here?

I do also get these weird statements in the log:

Failed to realize static UTType instance 0x10eb470b0 for identifier public.jpeg. Please file a bug. The type should be present in Core Types.

This is Xcode 13.0 on an M1 MacMini, tried the same code on an Intel mac and there they all return YES, so I'm guessing that this installation is messed up somehow.

As far as I tried your code, all three returned YES. How have you tested it?

For anyone who runs into this, the problem was that the app was running in Rosetta mode (Intel on Apple Silicon), which I wasn't aware of until I was researching other error messages from the simulator. If you have a look in Activity Monitor you can see if your app runs Apple or Intel in the "Kind" column.

Running the simulator in Intel/Rosetta mode on Apple Silicon is not supported, so it's weird that you can make it by changing Build Settings | Excluded Architectures = arm64 (for iOS Simulator). This fairly complex app ran fine except for these UTType issues.

The reason for running in Intel mode was an included static library C++ library. I had to change the compilation of that library to be a .xcframework instead of just a fat library (multiple processor slices) and make an entry for the simulator that has both x86_64 and arm64 slices.

App is now running arm64 in the simulator and all 3 lines now return YES.

-[UTType conformsToType:] broken in iOS15?
 
 
Q