我正在嘗試編寫使用tableView的單元測試,並且無法訪問單元格。cellForRowAtIndexPath在單元測試中爲零
這始終是零:
- (void)testDidEndEditingUpdatesLiftRecords {
TextViewCell *cell = (TextViewCell *) [tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
儘管我設置的數據源中的設置
- (void)setUp {
[super setUp];
source = [[MyDataSource alloc] init];
tableView = [[UITableView alloc] init];
[tableView setDataSource:source];
什麼能
是否設置爲代表你的表視圖訪問直的? – Amit 2013-05-14 12:58:09
你可以顯示你爲代表寫的代碼嗎? – 2013-05-14 12:59:34
你的tableView中有沒有內容,或者它是空白的? – 2013-05-14 13:10:19