Note that there are some explanatory texts on larger screens.

plurals
  1. POindexPathForCell returning NULL under IOS 7, works fine under IOS 6
    primarykey
    data
    text
    <p>I'm hoping now apps for IOS 7 are being accepted by Apple we can talk about it?</p> <p>I'm trying to fix my app so it works on IOS 7 and have made some very good progress this evening. I have two outstanding issues, but will post them separately. The first issue is this line (I added a log line after to debug it) ...</p> <pre><code> NSIndexPath *indexPath = [settingsTableView indexPathForCell:(UITableViewCell *)[sender superview]]; NSLog(@"Changed %@ &lt;-**-&gt; %@", [sender superview], indexPath ); </code></pre> <p>The log shows ....</p> <p><strong>IOS7</strong></p> <pre><code> 2013-09-11 22:18:02.985 BusTimes[21013:a0b] Changed &lt;UITableViewCellScrollView: 0xbfc1c80; frame = (0 0; 320 44); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = &lt;NSArray: 0xbfc1e70&gt;; layer = &lt;CALayer: 0xbfc1540&gt;; contentOffset: {0, 0}&gt; &lt;-**-&gt; (null) 2013-09-11 22:18:08.577 BusTimes[21013:a0b] Changed &lt;UITableViewCellScrollView: 0xbfc62d0; frame = (0 0; 320 44); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = &lt;NSArray: 0xbfc64c0&gt;; layer = &lt;CALayer: 0xbfc5b90&gt;; contentOffset: {0, 0}&gt; &lt;-**-&gt; (null) </code></pre> <p><strong>IOS 6</strong></p> <pre><code>2013-09-11 22:25:34.495 BusTimes[2116:907] Changed &lt;UITableViewCell: 0x20862f40; frame = (0 179; 320 44); text = 'Reminder Mins: 5'; autoresize = W; layer = &lt;CALayer: 0x208523d0&gt;&gt; &lt;-**-&gt; &lt;NSIndexPath 0x20861430&gt; 2 indexes [0, 3] 2013-09-11 22:25:47.499 BusTimes[2116:907] Changed &lt;UITableViewCell: 0x20865180; frame = (0 223; 320 44); text = 'AutoRefresh Secs: 60'; autoresize = W; layer = &lt;CALayer: 0x20865340&gt;&gt; &lt;-**-&gt; &lt;NSIndexPath 0x2085c0d0&gt; 2 indexes [0, 4] </code></pre> <p>So on IOS 7 indexPath is always (null) and .section and .row are always 0. But this works fine on IOS 6 and returns .section 0 and row 3, and .row 4. Can anyone suggest how I might get IOS 7 to behave in the same way for me?</p> <p>Many Thanks in advance.</p> <p>Plasma</p> <p><strong>* SOLUTION - I changed my code to this following the comments *</strong></p> <pre><code>UIView *view = sender; while (![view isKindOfClass:[UITableViewCell class]]) { view = [view superview]; } NSIndexPath *indexPath = [settingsTableView indexPathForCell:(UITableViewCell *)view]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload