views:

353

answers:

2

Hi Everyone:

TTMessageController (from the Three20 framework) was recommended to me to replicate the email creation behavior. However, I am running into a bit of a problem integrating it with my application. The rest of my application uses a UINavigationController in order to show the various UIViewControllers, but it doesn't seem that TTMessageController works when called by -pushViewController. When I attempt to use pushViewController for a TTMessageController, the size of the view becomes smaller and the buttons on the navigation bar stop working. If anyone could give me any advice regarding how to show the TTMessageController correctly using this method, please let me know.

Thanks for any help!

+1  A: 

You should present it modally, using presentModalViewController:animated:.

Jasarien
Thanks for your reply Jasarien! However, when I call it using this method, it seems to get rid of the navigation bar. Is there some way to fix this?
PF1
Hmm. I'm not sure exactly what you mean. It hides your existing navBar with its own? (expected), or it doesn't have any bar at all? The Message controller should have its own bar with its own buttons, which when displayed modally, will cover any nav bar you currently have, until the modal view controller is dismissed. Is this not what you're seeing?
Jasarien
Using the example MessageTestController.m class that came bundled in TTCatalog, with the following code only result in the view being displayed (with no navigation bar):MessageTestController *testing = [[MessageTestController alloc] init];UIViewController *viewController = [testing composeTo:@"Testing"];[self.navigationController presentModalViewController:viewController animated:YES];
PF1
MessageTestController in the TTCatalog sample is not the message controller. It's a test controller that presents two buttons to demonstrate launching a message controller or a post controller. You should use TTMessageController *messageController = [[TTMessageController alloc] init]; and then present messageController modally.
Jasarien
That makes sense. However, even when I try the given code to create the class, and then use [self.navigationController presentModalViewController:messageController animated:YES], it still doesn't display a navigation bar. Any ideas?
PF1
Is it somehow possible that the presentModalViewController code is only displaying the content view?
PF1
It's possible. You could try creating a navigation controller and set the messageController as its root view controller and then present the navigation controller modally. That will guarantee that a nav bar is shown. Whether or not the buttons for the messageController will be set correctly, I can't say.
Jasarien
That works great Jasarien! Thanks!
PF1
A: 

You should use also the TTNavigator component from the Three20 library.

For instance, basic navigationController doesnt not dispatch appear/disappear events ... so I assume Three20 components work better together !

Thomas Decaux