I am developing an iPad application using sdk 5 and storyboard. I´m following the [OAuth2] Tutorial and sample.1
I have port the code to a Singleton. Create a new view everytime initSesion is called:
viewController = [[GTMOAuth2ViewControllerTouch alloc] initWithScope:scope
clientID:kMyClientID
clientSecret:kMyClientSecret
keychainItemName:kKeychainItemName
delegate:self
finishedSelector:@selector(viewController:finishedWithAuth:error:)];
//viewController.keychainItemAccessibility = kSecAttrAccessibleAlways;
NSDictionary *params = [NSDictionary dictionaryWithObject:@"en"
forKey:@"hl"];
//viewController.signIn.additionalAuthorizationParameters = params;
NSString *html = @"<html><body bgcolor=silver><div align=center>Loading sign-in page...</div></body></html>";
viewController.initialHTMLString = html;
[[self navigationController] pushViewController:viewController
animated:YES];
But, when another Viewcontroller call the simgleton, the view pushed is not display.
Teorically, a navigator Controller use a stack to show differents view, so, if i´m in the correct way, that function must launch the GTMOAuth2ViewControllerTouch.view, to log in using OAuth2, thats occur in the sample. But nothing happen.
What´s going on? Thanks in advance.
Check if you have a navigation controller, it could be nil. Use debug mode or put a NSLog:
If you have no created a navigationController, try use the singleton of the app to get it, something like: