• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: -[UITable indexPathsForRowsInRect:] returning bogus paths?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[UITable indexPathsForRowsInRect:] returning bogus paths?


  • Subject: Re: -[UITable indexPathsForRowsInRect:] returning bogus paths?
  • From: Rick Mann <email@hidden>
  • Date: Thu, 18 Aug 2011 14:50:36 -0700

Huh. So it does. Thanks!

--
Rick

On Aug 18, 2011, at 14:47 , Luke Hiesterman wrote:

> 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)
>>
>> 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
>

_______________________________________________

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

References: 
 >-[UITable indexPathsForRowsInRect:] returning bogus paths? (From: Rick Mann <email@hidden>)
 >Re: -[UITable indexPathsForRowsInRect:] returning bogus paths? (From: Luke Hiesterman <email@hidden>)

  • Prev by Date: Re: -[UITable indexPathsForRowsInRect:] returning bogus paths?
  • Next by Date: Re: Entitlements and specific files/dirs
  • Previous by thread: Re: -[UITable indexPathsForRowsInRect:] returning bogus paths?
  • Next by thread: Autoscrolling when dragging?
  • Index(es):
    • Date
    • Thread