discuss-gnustep
[Top][All Lists]
Advanced

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

RE: Selectors and categories in GNUstep (porting from Cocoa)


From: Mondragon, Ian
Subject: RE: Selectors and categories in GNUstep (porting from Cocoa)
Date: Wed, 08 May 2002 18:00:06 -0500

andreas -

  i'm heading home in a minute & i'll respond in depth in an hour or two.  i
just assumed it was an NSString from the method name.  what kind of object
is "leftValue"?  that's the key to this (run-time) problem.

- ian

> -----Original Message-----
> From: Andreas Hoeschler [SMTP:ahoesch@advanced-science.com]
> Sent: Wednesday, May 08, 2002 5:25 PM
> To:   Mondragon, Ian
> Cc:   discuss-gnustep@gnu.org
> Subject:      Re: Selectors and categories in GNUstep (porting from Cocoa)
> 
> Hi Ian,
> 
> thanks for the quick response.
> 
> > well, to start off with, change this:
> >
> > switch ([attributeNames count])
> >
> > to this:
> >
> > switch (([attributeNames count]))
> 
> That helped. It were rather statements like this
> 
>       if (object = [self firstOne])
>               ...
> 
> that caused warnings under GNUstep.
> 
> 
> > as far as the "isEqualTo:" method not being found, you might not have
> > <Foundation/NSString.h> imported, or you may just need to typecast the
> > object to (NSString *) in order to avoid the warning.
> 
> Why NSString? According to my research the warnings are generated by the 
> following code:
> 
>    if (sel == FBQualifierOperatorNotEqual)
>        return [leftValue isNotEqualTo:rightValue];
>     else if (sel == FBQualifierOperatorLessThan)
>        return [leftValue isLessThan:rightValue];
>     else if (sel == FBQualifierOperatorGreaterThan)
>        return [leftValue isGreaterThan:rightValue];
>     else if (sel == FBQualifierOperatorLessThanOrEqualTo)
>        return [leftValue isLessThanOrEqualTo:rightValue];
>     else if (sel == FBQualifierOperatorGreaterThanOrEqualTo)
>        return [leftValue isGreaterThanOrEqualTo:rightValue];
>     else if (sel == FBQualifierOperatorContains)
>        return [leftValue doesContain:rightValue];
>     else if (sel == FBQualifierOperatorLike)
> 
> where sel is a selector (SEL) and FBQualifierOperatorNotEqual,... are 
> defined as follows:
> 
> #define FBQualifierOperatorEqual @selector(isEqualTo:)
> #define FBQualifierOperatorNotEqual @selector(isNotEqualTo:)
> #define FBQualifierOperatorLessThan @selector(isLessThan:)
> #define FBQualifierOperatorGreaterThan @selector(isGreaterThan:)
> #define FBQualifierOperatorLessThanOrEqualTo 
> @selector(isLessThanOrEqualTo:)
> #define FBQualifierOperatorGreaterThanOrEqualTo 
> @selector(isGreaterThanOrEqualTo:)
> #define FBQualifierOperatorContains @selector(doesContain:)
> #define FBQualifierOperatorLike @selector(isLike:)
> 
> Why is this causing
> 
> FBQualifier.m: In function `-[FBKeyValueQualifier evaluateWithObject:]':
> FBQualifier.m:390: warning: cannot find method.
> FBQualifier.m:390: warning: return type for `isEqualTo:' defaults to id
> FBQualifier.m:390: warning: pointer/integer type mismatch in conditional 
> expression
> FBQualifier.m:390: warning: return makes integer from pointer without a 
> cast
> FBQualifier.m:394: warning: cannot find method.
> FBQualifier.m:394: warning: return type for `isNotEqualTo:' defaults to 
> id
> FBQualifier.m:394: warning: return makes integer from pointer without a 
> cast
> FBQualifier.m:396: warning: cannot find method.
> FBQualifier.m:396: warning: return type for `isLessThan:' defaults to id
> FBQualifier.m:396: warning: return makes integer from pointer without a 
> cast
> FBQualifier.m:398: warning: cannot find method.
> FBQualifier.m:398: warning: return type for `isGreaterThan:' defaults to 
> id
> FBQualifier.m:398: warning: return makes integer from pointer without a 
> cast
> FBQualifier.m:400: warning: cannot find method.
> FBQualifier.m:400: warning: return type for `isLessThanOrEqualTo:' 
> defaults to id
> ...
> 
> Thanks,
> 
>     Andreas



reply via email to

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