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:0 inSection:0]];
浙公网安备 33010602011771号