discuss-gnustep
[Top][All Lists]
Advanced

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

Selectors and categories in GNUstep (porting from Cocoa)


From: Andreas Hoeschler
Subject: Selectors and categories in GNUstep (porting from Cocoa)
Date: Wed, 8 May 2002 23:49:46 +0200

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




reply via email to

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