views:

389

answers:

1

Hi,

demo works as expected, no problems. But now I'm trying to integrate it into my project. I use no xib-s, code only:

OAuthTwitterDemoViewController *vc = [[OAuthTwitterDemoViewController alloc] init]; [[UIApplication sharedApplication].keyWindow addSubview:vc.view]; [vc release];

it compiles and runs with no errors, but the actual OAuthTwitterDemoViewController is never visible. I've also tried it from a custom viewController with [self.view addSubview:vc.view]

What's the secret??


Update:

OK, here's what I did with NavigationController:

 TwitterAuthViewController *vc = [[TwitterAuthViewController alloc] init];

 UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:vc];
 [vc release];

 [self presentModalViewController:navigationController animated:YES];
 [navigationController release];
A: 

OK, the problems seems to be that I called [self presentModalViewController: controller animated: YES] from ModalViewController->NavigationController. That's where Cocoa touch OR Twitter-OAuth-iPhone (I don't really know which one exactly) have a problem. But this is how I need it.

Solution would be, as Ben already said, simply to push SA_OAuthTwitterController like [self.navigationController pushViewController:controller animated: YES];.

The only remaining problem is that SA_OAuthTwitterController internally creates own NavigationController bar, so that now I have 2 navigation bars visible.

Konstantin
The SA_OAuthTwitterController should be able to be used in Modal form; to get rid of your duplicate nav bars, just send one of your nav controllers a -setNavigationBarHidden: message.
Ben Gottlieb