iOS的一些小技巧(不定期更新)

脑子记不住,在这记下来备用

1解决 selectRowAtIndexPath:animated:scrollPosition不回调的问题:

问题:

Calling this method does not cause the delegate to receive a tableView:willSelectRowAtIndexPath: or tableView:didSelectRowAtIndexPath: message, nor will it send UITableViewSelectionDidChangeNotification notifications to observers.

解决 : 直接调用tableView的delegate的tableView:didSelectRowAtIndexPath:方法, 如:

[yourTable.delegate tableView:yourTable didSelectRowAtIndexPath:[NSIndexPathindexPathForRow:inSection:0]];

posted @ 2012-10-22 13:47  Wang Shai Ding  阅读(83)  评论(0)    收藏  举报