iphone - cellForRowAtIndexPath nil during unit tests -


i'm trying write unit test uses tableview, , i'm having trouble accessing cells.

this nil:

- (void)testdidendeditingupdatesliftrecords {     textviewcell *cell = (textviewcell *) [tableview cellforrowatindexpath:[nsindexpath indexpathforrow:0 insection:0]]; 

despite fact set data source in setup

- (void)setup {     [super setup];     source = [[mydatasource alloc] init];     tableview = [[uitableview alloc] init];     [tableview setdatasource:source]; 

what

as docs say, uitableview method cellforrowatindexpath: returns "an object representing cell of table or nil if cell not visible or indexpath out of range." thus, if cell not visible on tableview, method return nil.

note, method should not confused tableview:cellforrowatindexpath: method implement in our uitableviewdatasource. names confusingly similar.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -