Re: -[UITable indexPathsForRowsInRect:] returning bogus paths?
Re: -[UITable indexPathsForRowsInRect:] returning bogus paths?
- Subject: Re: -[UITable indexPathsForRowsInRect:] returning bogus paths?
- From: Luke Hiesterman <email@hidden>
- Date: Thu, 18 Aug 2011 21:47:58 +0000
- Thread-topic: -[UITable indexPathsForRowsInRect:] returning bogus paths?
It sounds like you're getting the index path you expect, but you're just surprised that cellForRowAtIndexPath: with that index path returns nil when it's scrolled out of view. If I'm reading that correctly, then this is correct behavior. Note the comment in UITableView.h:
- (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath; // returns nil if cell is not visible or index path is out of range
Luke
On Aug 18, 2011, at 2:38 PM, Rick Mann wrote:
Xcode 3.2.6, iOS 4.3 (8F190 simulator)
I'm calling -indexPathsForRowsInRect:, which always works correctly if the table isn't scrolled. But if the table is scrolled, and the supplied CGRect is not necessarily over a row in the table. I still get back what appears to be a valid array with a single NSIndexPath, with section and row of 0, 0.
But when I ask the table for the cell at that path, I get back nil (even though I know there's a cell there).
Is there something about that path that identifies it as bad? I don't see anything in its structure in the debugger.
thanks,
--
Rick
_______________________________________________
Cocoa-dev mailing list (email@hidden<mailto: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<http://lists.apple.com>
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
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