• 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: PB Compiler error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PB Compiler error


  • Subject: Re: PB Compiler error
  • From: Thomas Lachand-Robert <email@hidden>
  • Date: Tue, 23 Apr 2002 13:42:39 +0200

Le mardi 23 avril 2002, ` 01:04 , Ondra Cada a icrit :

[[ ExtendedDoubleVector allocWithZone:[self zone]] initWithSize: 64]

but I get a compile error informing me that this is a duplicate method from NSImage!!!

[snip]
Second, the warning just tells you that the initWithSize: method is declared in more different headers by more different ways, and since you send the initWithSize: message to id, the compiler can't determine which one is to be used.

- either change initWithSize: so that it does not clash with the NSImage'
s one (either by renaming it, or -- in this particular case probably impossible, but generally a good way -- by using exactly the same signature, which, in this case, would mean using an NSSize-typed argument)


I agree and insist: according to the usual phrasing in the framework, you should name your method initWithLength or initWithCount; both 'length' and 'count' are used for collections (see NSArray, NSString, NSDictionary...). 'size' in the framework means 'NSSize', that is, a two-dimensional (float)
data.

Obj-C is verbose, but this verbosity is very useful in you follow general rules, because you won't need to remember the types of parameters. This is all broken and annoying if you mix terms and use them in a different way than the framework.


Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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.

  • Prev by Date: [ANN] FoundationCollectionsPalette v1.0.0
  • Next by Date: Preventing newlines from wrapping
  • Previous by thread: [ANN] FoundationCollectionsPalette v1.0.0
  • Next by thread: Preventing newlines from wrapping
  • Index(es):
    • Date
    • Thread