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 17:01:50 -0500

well, to start off with, change this:

switch ([attributeNames count])

to this:

switch (([attributeNames count]))

that will kill the "truth value" warning.

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.

- ian mondragon

> -----Original Message-----
> From: Andreas Hoeschler [SMTP:ahoesch@advanced-science.com]
> Sent: Wednesday, May 08, 2002 4:50 PM
> To:   discuss-gnustep@gnu.org
> Subject:      Selectors and categories in GNUstep (porting from Cocoa)
> 
> Hi all,
> 
> this is my first serious attempt to port some code to GNUstep. While 
> stuff like the following works great on MacOSX
> 
> #define FBQualifierOperatorEqual @selector(isEqualTo:)
> if ([object respondsToSelector:FBQualifierOperatorEqual]) ...
> 
> it does not under GNUstep. For example [dic 
> respondsToSelector:@selector(name)] returns yes, where name is a 
> dictionary. NSSelectorFromString(...) often returns nil while I get back 
> a selector under MacOSX. Is there any other better working approach to 
> get a selector from a string?
> 
> There also seems to be a problem with categories. Implementing a method 
> qualifierForObject in a category or FBEntity
> 
> @implementation FBEntity (QualifierGeneration)
> 
> - (FBQualifier *)qualifierForObject:(FBObject *)object
> {
>     NSArray *attributeNames = [self primaryKeyAttributeNames];
>     switch ([attributeNames count])
> ...
> }
> 
> @end
> 
> leads to the following warnings.
> 
> FBQualifier.m: In function `-[FBEntity(QualifierGeneration) 
> qualifierForObject:]':
> FBQualifier.m:90: warning: suggest parentheses around assignment used as 
> truth value
> FBQualifier.m: In function `-[FBRelationship(QualifierGeneration) 
> destinationQualififerForObject:]':
> FBQualifier.m:120: warning: suggest parentheses around assignment used 
> as truth value
> FBQualifier.m:132: warning: suggest parentheses around assignment used 
> as truth value
> FBQualifier.m: In function `-[FBKeyValueQualifier evaluateWithObject:]':
> FBQualifier.m:390: warning: cannot find method.
> FBQualifier.m:390: warning: return type for `isEqualTo:' defaults to id
> 
> What does this mean? Am I missing anything? How can this be fixed?
> 
> Thanks a lot,
> 
>     Andreas
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep



reply via email to

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