Jaanus तरह से कहा: एनिमेटेड: scrollPosition :) विधि प्रतिनिधि एक tableView प्राप्त करने के लिए कारण नहीं है
इस (-selectRowAtIndexPath कॉलिंग: willSelectRowAtIndexPath: या तालिका दृश्य: didSelectRowAtIndexPath: संदेश, और न ही पर्यवेक्षकों को UITableViewSelectionDidChangeNotification अधिसूचनाएं भेज देगा।
तो आपको बस delegate
विधि स्वयं को कॉल करना होगा।
उदाहरण के लिए:
स्विफ्ट 3 संस्करण:
let indexPath = IndexPath(row: 0, section: 0);
self.tableView.selectRow(at: indexPath, animated: false, scrollPosition: UITableViewScrollPosition.none)
self.tableView(self.tableView, didSelectRowAt: indexPath)
ObjectiveC संस्करण:
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:0];
[self.tableView selectRowAtIndexPath:indexPath
animated:YES
scrollPosition:UITableViewScrollPositionNone];
[self tableView:self.tableView didSelectRowAtIndexPath:indexPath];
स्विफ्ट 2।3 संस्करण:
let indexPath = NSIndexPath(forRow: 0, inSection: 0);
self.tableView.selectRowAtIndexPath(indexPath, animated: false, scrollPosition: UITableViewScrollPosition.None)
self.tableView(self.tableView, didSelectRowAtIndexPath: indexPath)
मुझे एक ही समस्या का सामना करना पड़ा और बस लिंक ठीक करें: http://stackoverflow.com/questions/5324501/select-tableviews-row-from-an-another-view मुझे आशा है कि यह आपके लिए सहायक होगा। – michael