• 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
Re: multiple declarations...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple declarations...


  • Subject: Re: multiple declarations...
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 5 Jun 2002 00:41:34 +0200

On Tuesday, June 4, 2002, at 11:58 , email@hidden wrote:

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...

Never mind that, just cast to any of them, like (NSString*).

The problem is a slight a non-fatal design flaw in OpenStep: there should have been -compare:(id), and a number of -compareWithString:(NSString*) and alike.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.
References: 
 >multiple declarations... (From: email@hidden)

  • Prev by Date: Relaunching application
  • Next by Date: Re: Relaunching application
  • Previous by thread: Re: Relaunching application
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread