multiple declarations...
multiple declarations...
- Subject: multiple declarations...
- From: email@hidden
- Date: Tue, 4 Jun 2002 14:58:27 -0700
what strategy do people use to quiet down compiler warnings about
multiple declarations in cases like this:
// get the key named context out of the two objects a and b and compare
them.
int compare(id a, id b, void *context) {
id va = [a valueForKey:(id)context];
id vb = [b valueForKey:(id)context];
return [va compare:vb]; // this line produces the warning...
}
I know that the value's in va and vb are either strings, numbers, or
dates...
I get the following compiler warnings... is there a cast I can use to
quiet it down?
Controller.m: In function `compare':
Controller.m:77: warning: multiple declarations for method `compare:'
/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:53:
warning: using `-(NSComparisonResult)compare:(NSNumber *)otherNumber'
/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h:29:
warning: also found `-(NSComparisonResult)compare:(NSDate *)other'
/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:67:
warning: also found `-(NSComparisonResult)compare:(NSString *)string'
Note, that i use that function in the following manner:
[aDictionaryObjectHere sortUsingFunction:compare context:aStringKeyHere];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.