discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Warning with clang, error with gcc : attached files


From: Bertrand Dekoninck
Subject: Re: Warning with clang, error with gcc : attached files
Date: Fri, 3 May 2019 13:39:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1



Le 30/04/2019 à 18:33, David Chisnall a écrit :
On 30/04/2019 15:34, Bertrand Dekoninck wrote:
OK, thanks for your quick answer. I don't see any either, but I could try to modify NSButtonCell.h locally to have this method public. Maybe I need more help.

Normally, the fix for this kind of thing is to declare a category on NSButtonCell that exposes the method that you want.  It's somewhat fragile, so best practice would be to have a dynamic check in your +initialize that checks that the method does exist.

While investing in this way, I wondered if a solution of the kind hereafter would be correct :

I replace this  :

 GSThemeControlState buttonState =  [self themeControlState];

(which caused a warning because themeControlState is not public, and an error with gcc because GSControlState is not a pointer... )

with that :

 SEL aSelector = @selector(themeControlState);
 GSThemeControlState buttonState =  (GSThemeControlState)[self performSelector:aSelector withObject:nil];


I don't have any warning when a replace the direct call to themeControlState with a selector + a cast in this way.


What do you think, guys ?

Cheers, Bertrand




reply via email to

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