Hi,
when I see something like this for example in ProjectCenter:
- (NSInteger)numberOfRowsInTableView: (NSTableView *)aTableView
{
return [docTypesItems count];
}
where docTypesItems is a NSMutableArray. I see many of the GUI elements
use NSInteger. But for example NSArray, or NSDictionary count return
NSUInteger.
When I see above statement, how is best way to proceed to not for
example return a too large NSUInteger, which would convert into
a negative NSInteger?
Since most of the time I see contents of tables, browsers and whatnot
stored in NSArrays or NSDictionaries, nearly everywhere I came across
I see this potential trouble with the signed vs. unsigned
discrepancies when setting it up in the GUI.
Also often I see some of those results then compared, actually comparing
a NSUInteger against a NSInteger. When one is too large, or the other
negative, funny things may happen.
Is there some best practices, how to handle that? Or is there something in
the runtime, I am not aware of, that takes care about it?
Sebastian
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep