0
votes

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];
1
Have you tried pushing the view controller to a nav controller? Do your other views appear properly?Ben Gottlieb
That was fast, Ben! Yes, UINavigationController helped a lot - I can see TwitterAuthViewController's view. But now I get EXC_BAD_ACCESS... Will try to investigate the issue. Any thoughts why it works from UINavigationController and not as I did it before?..cocoapriest
BTW, I updated the code abovecocoapriest

1 Answers

0
votes

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.