Re: Unimplemented Selector Warning 3
Re: Unimplemented Selector Warning 3
- Subject: Re: Unimplemented Selector Warning 3
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 21 Aug 2012 23:52:21 +0700
On 21 Aug 2012, at 22:18, Roland King <email@hidden> wrote:
> I'm assuming it's -Wselector, if it is, then that will warn if a selector inside @selector() does not have a corresponding method in the current compilation unit. I don't know if adding an import declaring that selector is enough, if not, then Wselector is not as useful as it could be.
I set Undeclared Selector to NO and build again - same warnings.
>
>
> On 21 Aug, 2012, at 11:07 PM, Andy Lee <email@hidden> wrote:
>
>> On Aug 21, 2012, at 2:18 AM, Gerriet M. Denkmann <email@hidden> wrote:
>>
>>> (I hope you don't see this more than once - some problems with Mail)
>>>
>>>
>>> I messed around with my Build Settings - activating more warnings. (Almost) always a good idea.
>>>
>>> I have:
>>> NSView *someSubclassOfView = ....;
>>> if ( [ someSubclassOfView respondsToSelector: @selector(getRow:column:forPoint:) ] )
>>> {
>>> // this is a browser or a matrix or something else
>>> // do something...
>>> }
>>>
>>> And get a warning: "Unimplemented selector 'getRow:column:forPoint:'".
>>
>> What line is the warning coming from? If you are doing
>>
>> BOOL isOnCell = [someSubclassOfView getRow:&row
>> column:&column
>> forPoint:point];
>>
>> The problem might be that someSubclassOfView is declared as an NSView. You can fix with a cast:
>>
>> BOOL isOnCell = [(NSTableView *)someSubclassOfView getRow:&row
>> column:&column
>> forPoint:point];
>>
>>> Same problem with:
>>> #import "Server.h" // declares: - (void) reset;
>>> [ currentServers makeObjectsPerformSelector: @selector(reset) ];
>>>
>>> And:
>>> #import "SomeClass.h" // declares: - (void) someMethod: something;
>>> SomeClass *someClass = ...;
>>> [ someClass performSelectorOnMainThread: @selector(someMethod:) withObject: nil waitUntilDone: NO ];
>>
>> I don't know about these. Is the warning definitely coming from the performSelector lines?
>>
>> What are the warnings you activated? I can try to reproduce the problem.
>>
>> --Andy
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden