Re: How many items can add into table view
Re: How many items can add into table view
- Subject: Re: How many items can add into table view
- From: mmalc crawford <email@hidden>
- Date: Mon, 21 Jan 2008 07:04:10 -0800
On Jan 21, 2008, at 5:23 AM, Gregory Weston wrote:
2 billion or more. Since table views don't store data - only display
it - the number of items is limited to the greatest value of
NSInteger (in 10.5, int earlier). And that limit exists only because
that's the return type for numberOfRowsInTableView:. As long as
whatever structure you're storing your data in doesn't have a lower
limit, you're probably fine.
You could test this for usability (because the scrollbar will be
very finicky) by implementing a simple data source that returns
MAXINT from numberOfRowsInTableView. and [NSNumber
numberWithInt(eger):rowIndex] from
tableView:objectValueForTableColumn:row:.
Just for the sake of publicising the new API: since you mentioned
NSInteger, technically for 10.5+ it might be more appropriate to write
"a simple data source that returns *NSIntegerMax* from
numberOfRowsInTableView: and [NSNumber numberWithInteger:rowIndex]
from tableView:objectValueForTableColumn:row:" (although I appreciate
that on a 64-bit system this is a rather large number for testing...).
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden