Curnelious
Curnelious

Reputation: 1

Get indexpath item of UITableview in ios5

I have seen this topic before ,I know iOS5 has another way to do that, but I couldn't find it.

If I using this function in iOS5.

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

I get a crash when trying to NSLog the indexPath.item. The some problem with .item. How I have to replace that to fit iOS5 and also iOS6?

Upvotes: 3

Views: 301

Answers (1)

wattson12
wattson12

Reputation: 11174

item is a property added for UICollectionViews in iOS 6, a UITableView index path uses the row property. use indexPath.row instead

Upvotes: 6

Related Questions