The navigationBar goes back, but the view stays the same. What gives?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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 atindexPath = [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.