FROM : Andy Lee
DATE : Wed Nov 13 20:08:03 2002
At 7:34 PM -0500 11/13/02, Cameron Hayne wrote:
>what is missing is the documentation. The behaviour seems to be an
>unstated convention rather than something that is necessarily true.
>Even using AppKiDo I fail to see anything that says that the method
>numberWithInt that NSDecimalNumber inherits from NSNumber returns an
>NSDecimalNumber.
I've only been skimming this thread, but for some reason when I saw
AppKiDo mentioned, I found it more interesting. ;)
I agree that the classes of objects returned by instantiators should
be better documented, especially since they usually return id's. For
example, the doc for [NSArray +arrayWithObjects:] says:
Creates and returns an array containing the
objects in the argument list.
At the very least, they could have said
Creates and returns an instance of the receiver
containing the objects in the argument list.
They could have gone a bit further and added:
The returned array is an instance of the class
object that received the message. For example,
[NSMutableArray arrayWithObjects:...] returns a
mutable array.
Even if the convention is documented elsewhere, IMO it's worth adding
these few words to the individual method docs.
This discussion has inspired me to file a bug on this. The Problem
ID# is 3100874.
--Andy
DATE : Wed Nov 13 20:08:03 2002
At 7:34 PM -0500 11/13/02, Cameron Hayne wrote:
>what is missing is the documentation. The behaviour seems to be an
>unstated convention rather than something that is necessarily true.
>Even using AppKiDo I fail to see anything that says that the method
>numberWithInt that NSDecimalNumber inherits from NSNumber returns an
>NSDecimalNumber.
I've only been skimming this thread, but for some reason when I saw
AppKiDo mentioned, I found it more interesting. ;)
I agree that the classes of objects returned by instantiators should
be better documented, especially since they usually return id's. For
example, the doc for [NSArray +arrayWithObjects:] says:
Creates and returns an array containing the
objects in the argument list.
At the very least, they could have said
Creates and returns an instance of the receiver
containing the objects in the argument list.
They could have gone a bit further and added:
The returned array is an instance of the class
object that received the message. For example,
[NSMutableArray arrayWithObjects:...] returns a
mutable array.
Even if the convention is documented elsewhere, IMO it's worth adding
these few words to the individual method docs.
This discussion has inspired me to file a bug on this. The Problem
ID# is 3100874.
--Andy
| Related mails | Author | Date |
|---|---|---|
| James Powell | Nov 12, 22:40 | |
| James Powell | Nov 13, 11:31 | |
| Andreas Mayer | Nov 13, 13:23 | |
| James Powell | Nov 13, 14:09 | |
| Andreas Mayer | Nov 13, 15:49 | |
| Cameron Hayne | Nov 13, 16:35 | |
| Jeff Disher | Nov 13, 16:52 | |
| Andreas Mayer | Nov 13, 17:16 | |
| Andreas Mayer | Nov 13, 17:45 | |
| Andreas Mayer | Nov 13, 17:53 | |
| James Powell | Nov 13, 18:11 | |
| Andy Lee | Nov 13, 20:08 | |
| Andreas Mayer | Nov 14, 06:49 | |
| Andy Lee | Nov 14, 08:30 | |
| Andreas Mayer | Nov 14, 13:17 |






Cocoa mail archive

