On 13 Apr 2009, at 22:13, Kyle Sluder wrote:
On Mon, Apr 13, 2009 at 4:47 PM, [email protected]
<[email protected]> wrote:
NSDecimalNumber *n2 = nil;
n1 = [n1 decimalNumberByAdding:n2];
You can't assume that nil is a valid argument. So no, the lack of any
documentation stating that "passing nil will blow up" is not a bug.
Whatever way you slice it, bug or not, this is fairly toxic behaviour.
Checking the docs again I see that the previously listed method, -
compare: does carry a caveat:
- (NSComparisonResult)compare:(NSNumber *)decimalNumber
Parameters
decimalNumber
The number with which to compare the receiver.
This value must not be nil. If this value is nil, the behavior is
undefined and may change in future versions of Mac OS X.
--Kyle Sluder
Jonathan Mitchell
Central Conscious Unit
http://www.mugginsoft.com
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]