TTPostController

58 views
Skip to first unread message

Aaron Berk

unread,
Nov 23, 2009, 5:06:03 PM11/23/09
to Three20
I'm having difficultly doing something I'm imagining should be simple,
but I cannot figure it out...

I want to use a TTPostController, but I can't figure out how to
initialize and display it. I have used the a TTPhotoViewController
which essentially is called in the same way as a standard view
controller, but being that the TTPostController is not standard, what
is the code to initialize and display a TTPostController?

Thanks!!

uprise78

unread,
Nov 23, 2009, 6:07:37 PM11/23/09
to Three20
A quick look at TTPostController.h reveals that it is a subclass of
TTPopupViewController. That is probably a good place to start.

David Morford

unread,
Nov 23, 2009, 6:23:18 PM11/23/09
to thr...@googlegroups.com
The popup view controller acts like pseudo modal view controller and is a clever pattern. The base class is more of a protocol with implementation left to subclasses and display handled by TTNavigator. If you look at the MessageTestController class in TTCatalog, you can see a selector mapping for the post controller in the init method, which in turn calls the post: method and returns a TTPostController instance. TTNavigator then handles the displaying the view overtop the current view controller in it's presentPopupController:parent:animated, which calls showInView:animated implementation on TTPostController.


Cheers,
Dave
> --
>
> You received this message because you are subscribed to the Google Groups "Three20" group.
> To post to this group, send email to thr...@googlegroups.com.
> To unsubscribe from this group, send email to three20+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/three20?hl=.
>
>

Aaron Berk

unread,
Nov 24, 2009, 12:42:18 AM11/24/09
to Three20
Hmmm...maybe got a little further, but still lost a bit. I'll try a
little more tomorrow and post any questions/issues I may run into.

Thanks!

Travis

unread,
Dec 7, 2009, 3:10:33 AM12/7/09
to Three20
If you're looking to use TTPostController without the use of
TTNavigator you can do something like:

TTPostController *postController = [[TTPostController alloc] init];
postController.delegate = self; // self must implement the
TTPostControllerDelegate protocol
self.popupViewController = postController;
postController.superController = self; // assuming self to be the
current UIViewController
[postController showInView:self.view animated:YES];
[postController release];



And then to grab the text entered by the user with (see the bottom of
TTPostController.h for other methods available):

- (void)postController:(TTPostController *)postController
didPostText:(NSString *)text
withResult:(id)result {
NSLog(@"Text: %@", text);
}


Hope that is helpful,
Travis

Dmitry Mikheev

unread,
Dec 25, 2009, 11:47:17 AM12/25/09
to Three20
Thanks Travis!!! Your post is the most helpful

Ajay

unread,
Jan 15, 2010, 5:28:56 PM1/15/10
to Three20
Travis,

Thanks SO MUCH from me too. The sample code is VERY helpful.

PS: I updated the keyboard type to number using this:

[postController.textView setKeyboardType:UIKeyboardTypeNumberPad];

Thanks

Ajay

On Dec 7 2009, 3:10 am, Travis <travis.i.wy...@gmail.com> wrote:
> If you're looking to useTTPostControllerwithout the use of


> TTNavigator you can do something like:
>

>        TTPostController*postController = [[TTPostControlleralloc] init];


>         postController.delegate = self; // self must implement the
> TTPostControllerDelegate protocol
>         self.popupViewController = postController;
>         postController.superController = self; // assuming self to be the
> current UIViewController
>         [postController showInView:self.view animated:YES];
>         [postController release];
>

> And then to grab the text entered by the user with (see the bottom ofTTPostController.h for other methods available):

Reply all
Reply to author
Forward
0 new messages