iOS 6 Table View crashes when deployed to iOS 5

Apple have changed the UITableViewController template in iOS 6 a bit. Specifically, when you create a new UITableViewController class, it’s created using something like this (in the cellForRowAtIndexPath method):

When run in iOS 5 the app crashes. The culprit seems to be the addition of forIndexPath:indexPath in this declaration which is only available in iOS 6. To make it work in either iOS version, simply take it out, like so:

The full code from an iOS 5 template is:

About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

1 thought on “iOS 6 Table View crashes when deployed to iOS 5

  1. It appears that this problem has been fixed in Xcode 4.6: when you create a new UITableViewController subclass, it’s back to what it was in iOS 5.

    Thank you, Apple!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.