• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
multiple declarations...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: multiple declarations...
      • From: Ondra Cada <email@hidden>
    • Relaunching application
      • From: email@hidden
  • Prev by Date: Re: [newbie] Reading a CSV file
  • Next by Date: drawing NOW in a callback, boom!
  • Previous by thread: Troubles with [NSWindow setMiniwindowImage]
  • Next by thread: Relaunching application
  • Index(es):
    • Date
    • Thread