iOS 14 CFAssertMismatchedTypeID

I see a lot of questions about CFAssertMismatchedTypeID. Is this a system bug now ?

I see a lot of questions about CFAssertMismatchedTypeID.

And yet you only posted one of them. Clearly there’s some backstory here and I’ll be able to give you a better answer if you include that backstory.

Is this a system bug now ?

Not necessarily. CFAssertMismatchedTypeID is an assert, that is, it’s code within Core Foundation that checks whether an object is of the expected type and crashes if it’s not. Whether this is a system bug depends on the source of that object. For example, this code trips the assert (on macOS 11.6) because its clearly broken:

let i = "Hello Cruel World!" as NSString
let o = CFUUIDCreateString(nil, unsafeBitCast(i, to: CFUUID.self))
print(o)

OTOH, it’s possible that you’re seeing system code trip the assert, and that could be a bug in the system or it could be a more subtle bug in your code.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

iOS 14 CFAssertMismatchedTypeID
 
 
Q