4 ms·
This is a very common in iOS. You can preload the array. inside cellForRowAtIndexPath return the array instead of the cell. works perfectly.
by beatle 15y ago
This is a very common in iOS. You can preload the array. inside cellForRowAtIndexPath return the array instead of the cell. works perfectly.
- spicyj 15y agoI'm not sure what you could mean -- tableView:cellForRowAtIndexPath: returns a UITableViewCell *. Do you have an article describing what you're talking about?
- beatle 15y agoSorry I wasn't very clear. generally speaking this is a bad idea but it works great if you have a small table. 1) in my ViewDidLoad I create an array of cells. 2) Then in my cellForRowAtIndexPath, I return the particular cell in my array. - (UITableViewCell )tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; return [cellArray objectAtIndex:row]; }