Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to delete row in TTTableViewController (Three20)
    text
    copied!<p>The Three20 is great library. It's making the work with tables very easy. But one gap that I noticed - is deletion of rows, with animation. I spent many hours trying to do this, and this is what I'm doing:</p> <pre><code>// get current index patch UITableView* table = [super tableView]; NSIndexPath *indexPath = [table indexPathForSelectedRow]; //delete row in data source TTListDataSource * source = (TTListDataSource *)self.dataSource; [source.items removeObjectAtIndex:indexPath.row]; // delete row from the table, with animation [table deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; </code></pre> <p>After this code runs the error appears: [NSCFArray objectAtIndex:]: index (0) beyond bounds (0)</p> <p>I'm using the class inherited from the TTTableViewController. And I doesn't implement the DataSourceDelegate or TableViewDelegate because I'm using the Three20 as much as possible. So, this is how I create datasource:</p> <pre><code>for(NSDictionary *album in (NSArray *)albums){ TTTableRightImageItem *item = [TTTableRightImageItem itemWithText:@"name" imageURL:@"image url" defaultImage:nil imageStyle:TTSTYLE(rounded) URL:@"url of selector where I actually catch the tap on a row"]; [tableItems addObject:item]; } self.dataSource = [TTListDataSource dataSourceWithItems:tableItems]; </code></pre> <p>I read this article (<a href="https://stackoverflow.com/questions/1384659/unable-to-delete-rows-in-table-using-three20">article</a>) but it doesn't help :(</p> <p>So, I know that this is very simple for gurus from this site. Can you just give me advanced sample of how to do this</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload