Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug: unsigned short, NSArrayController, NSTableView?



I don't know if this is a defined behavior or a bug, so I thought I would toss it out here before submitting it as a bug. The punch-line is that an NSTableView column that is fed data via an NSArrayController does not display large values for unsigned shorts correctly.


I have an NSObject subclass that has an unsigned short to represent a 16-bit TCP port. The accessors also use an unsigned short for setting/retrieving the value.


The objects are placed in an NSMutableArray which is tracked by an NSArrayController. An NSTableView's columns bind to the NSArrayController for their data.

THE PROBLEM: When the port value is a large number (e.g., when the highest order bit is set), the table view shows a negative number instead of a large positive number.

The work around was easy enough: just make the port a 32-bit number.

Is this the defined behavior (i.e., not supporting unsigned shorts), and is therefore my mistake?

Or is this a bug that should be reported?


Thanks,

Todd

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.