tags:

views:

152

answers:

1

On my default navbar's rootview (a chatroom of sorts) I have a title bar, with a rightBarButton "compose", which pops up a uitextview and keyboard to enter a new chat message. After you hit "send", the message sends back to the server to store it in the db, that works fine.

When I close the uitextview and load the rootview back, I do:

[newMessageEntry resignFirstResponder];
[self loadView];

That does show the chat messages successfully, but I'm not sure how to auto-refresh it so it picks up the message you just submitted. I'm thinking the "self loadView" doesn't really load up the view with all the code, because in that view's 'viewDidLoad' method, I start the code to load the messages from the server and display them, but that code is not running.

Am I making any sense? Hello? Is this thing on? :)

A: 

From help on another forum, hoping this helps some people here:

I needed to use

    [self.view setNeedsDisplay];
[self loadView];

setNeedsDisplay set that view to be refreshed with data when it's loaded up.