tags:

views:

19

answers:

2

Hello. I am Japanese.

The error goes out when scrollRowToVisible is executed. 'UITableView' ..in Xcode.. May not respond to '- scrollRowToVisible'

It writes as follows. IBOutlet UITableView *tableViews; [tableViews scrollRowToVisible:2]; I want to move it to the second line.

ReloadData operates.

Why

A: 

reloadData is a valid method on UITableView. scrollRowToVisible: is not, and I have no idea where you got it—there's nothing else called that in the API. The method you're looking for is -scrollToRowAtIndexPath:atScrollPosition:animated:, which you'd use like this:

[tableViews scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0] atScrollPosition:UITableViewScrollPositionNone animated:YES];
Noah Witherspoon
thank you!!It solved it.
Shingo
A: 

scrollRowToVisible: is for using in desktop Mac applications, with an NSTableView. If you're programming for iPhone, use scrollToRowAtIndexPath:atScrollPosition:animated: instead.

nevan
thank you!!It solved it.
Shingo
Glad I could help.
nevan