Scrolling when I create a new item


#1

I just finished adding the Edit and New buttons and connecting them to the appropriate methods, but when I create a new row, it adds it correctly, but scrolls everything in the UITableView down a few points. It does this every time I hit “New” until it scrolls off the screen. Any suggestions as to what I can look at that may be causing this, because I’m at a loss.

Thanks!

On Program Launch

After hitting “New” a few times

Here’s my new item code. I didn’t do anything special to it.

[code]- (IBAction)addNewItem:(id)sender {
// Make a new index path for the 0th section, last row
// Create a new BNRItem and add it to the store
BNRItem *newItem = [[BNRItemStore sharedStore] createItem];

NSInteger lastRow = [[[BNRItemStore sharedStore] allItems] indexOfObject:newItem];

NSIndexPath *indexPath = [NSIndexPath indexPathForRow:lastRow inSection:0];

// Insert this new row into the table.
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationTop];

}[/code]


#2

slooker: did you ever resolve this? I’d be interested in hearing what you found.

It wouldn’t (likely) be in the code for addNewItem: since that’s just for the CONTENT of the tableview.

If I were to guess, I’d guess by checking out HeaderView.xib, selecting the view (NOT one of the buttons) and verifying the attributes. The Simulated Metrics should match the screenshot (page 182), and under View, the default Mode of “Scale To Fill” works fine for me.

FWIW.