Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Last active December 26, 2015 09:29
Show Gist options
  • Save jcromartie/7130038 to your computer and use it in GitHub Desktop.
Save jcromartie/7130038 to your computer and use it in GitHub Desktop.
- (NSIndexPath *)nextIndexPath:(NSIndexPath *)i
{
// apologies to any maintainer but this was some code golf going on in #iphonedev
id t=_tableView;
int s,r,n;s=i.section;r=(i.row+1)%[t numberOfRowsInSection:s];n=[t numberOfSections];
if(!r)for(;s<n&&![t numberOfRowsInSection:s+++1];);
return s==n?nil:[NSIndexPath indexPathForRow:r inSection:s];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment