开发者

Why isn't UINavigationController popping UITableViewController when I touch the back button?

The navigationBar goes back, but the view stays the same. What开发者_Python百科 gives?


I figured it out. I was scrolling to the bottom of the uitableview on viewDidAppear, but if the tableView was empty, the Debugger Console would spit out: CoreAnimation: ignoring exception: -[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:]: row (-1) beyond bounds (0) for section (0). This is because I was scrolling to the row at indexPath = [messages count] - 1, where messages is the table data source. I figured it was fine since it didn't crash, but when I hit back on the navigationBar after this, the navigationBar would go back, but the tableView stayed. Weird. Well, I fixed the exception by commenting out the viewDidAppear method alltogether. I could also add some logic to check if messages is empty before scrolling to the bottom of the tableView, but the scrolling isn't working exactly as I want anyhow. It shows the tableView, and then, scrolls to the bottom. I want it to be scrolled to the bottom of the tableView before the tableView even appears, like the iPhone Messages app (for text messaging) does. And I want to flash the scroll bar on the right too to show that the view is scrolled to the bottom.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜