gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CA broken; how do I differentiate NSValues for size and point?


From: Ivan Vučica
Subject: CA broken; how do I differentiate NSValues for size and point?
Date: Sun, 20 May 2018 13:03:38 +0100

Hi,

Pretty much all Core Animation demos are currently broken under GNUstep with a variation on the following:

2018-05-20 12:54:25.464 QuartzCoreDemo[13476:13476] Problem posting notification: <NSException: 0x15b53b8> NAME:NSInvalidArgumentException REASON:[GSSizeValue-pointValue] should be overridden by subclass INFO:(null)

CA is accessing -pointValue method if it determines that the passed NSValue matches the -objCType of NSPoint. It does not check for size values.

Clearly, sometimes it is trying to interpolate size values, which will match the signature and it will incorrectly attempt to access -pointValue which is then not implemented by GSSizeValue. I am not sure where might it be interpolating size values, but it seems to be doing so. (Alternative bug is that NSValue is incorrectly ingesting points as sizes, then complaining when the point provided is being interpreted as a point. I can try checking this later.)

I cannot check -respondsToSelector: because the class /does/ in fact respond to -pointValue; it just throws an exception.

Adding a try/catch in this kind of situation would make for some very poor code hygiene, in my opinion.

- Is NSValue supposed to be a class cluster like this? (Not on Mac at this time, can't check.)
- Is there a way out?
- Would it make sense to extend GSSizeValue and add -pointValue to it? (They're both 2d vectors.)

Thanks

reply via email to

[Prev in Thread] Current Thread [Next in Thread]