Skip to content

Instantly share code, notes, and snippets.

@rainhead
Created June 8, 2011 23:08
Show Gist options
  • Save rainhead/1015680 to your computer and use it in GitHub Desktop.
Save rainhead/1015680 to your computer and use it in GitHub Desktop.
@implementation TTPostController
- (void)dismissAnimationDidStop {
if ([_delegate respondsToSelector:@selector(postController:didPostText:withResult:)]) {
// _result is a NewConversationController instance w/ retainCount of 2
[_delegate postController:self didPostText:_textView.text withResult:_result];
}
TT_RELEASE_SAFELY(_originView);
[self dismissPopupViewControllerAnimated:NO];
}
...
@end
@implementation XXXAppDelegate
- (void)postController:(TTPostController *)postController didPostText:(NSString *)text withResult:(id)result {
// result == postController
if ([result isKindOfClass:[NewConversationModel class]]) {
TTNavigator *navigator = [TTNavigator navigator];
NSString *convoURL = ((NewConversationModel *)result).URL;
NSString *streamURL = [NSString stringWithFormat:@"tt://feed/%d", FeedTypeStream];
[navigator openURLAction:[[TTURLAction actionWithURLPath:convoURL] applyParentURLPath:streamURL]];
}
}
..
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment