Error: unrecognized selector sent to instance

Error

2021-07-17 17:22:01.168937+0900 MaskedBlur2[19987:9237645] -[NSConcreteValue X]: unrecognized selector sent to instance 0x2835e0690

2021-07-17 17:22:01.172931+0900 MaskedBlur2[19987:9237645] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSConcreteValue X]: unrecognized selector sent to instance 0x2835e0690’

*** First throw call stack:

(…)

libc++abi: terminating with uncaught exception of type NSException

*** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSConcreteValue X]: unrecognized selector sent to instance 0x2835e0690’

terminating with uncaught exception of type NSException


Cause

Unexpected data type was passed for a parameter.
In this case, forKey:kCIInputCenterKey is expecting CIVector, but CGPoint was passed.

OK

    var location: CIVector= CIVector(cgPoint: CGPoint(x: 0, y: 0))

    radialMask.setValue(imageCenter, forKey:kCIInputCenterKey)

Error

    var location: CGPoint= CGPoint(x: 0, y: 0)

    radialMask.setValue(location, forKey:kCIInputCenterKey)