I'm trying to implement http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master into my code. I'm following the Demo provided and I can't seem to get it to work. Here is where I think the problem is currently.
So the example declares a view controller that handles the OAuth Connections and such in the app delegates header like so:
app delegate header:
import uikit/uikit.h( i had to change the syntax here so that it would work )
@class OAuthTwitterDemoViewController;
@interface OAuthTwitterDemoAppDelegate : NSObject { UIWindow *window; OAuthTwitterDemoViewController *viewController; }
@property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet OAuthTwitterDemoViewController *viewController;
@end
The app delegate impl:
@implementation OAuthTwitterDemoAppDelegate
@synthesize window; @synthesize viewController;
(void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
[window addSubview:viewController.view]; <------------------------ [window makeKeyAndVisible]; }(void)dealloc { [viewController release]; [window release]; [super dealloc]; }
@end
So as you can see where the arrow is that we never do an initWithNib or plain init, we just straight add it's view to the window.
What gets called on the viewController is:
OAuthTwitterDemoViewController
(void) viewDidAppear: (BOOL)animated { if (_engine) return; _engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate: self]; _engine.consumerKey = kOAuthConsumerKey; _engine.consumerSecret = kOAuthConsumerSecret;
[_engine requestRequestToken];
UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];
if (controller) [self presentModalViewController: controller animated: YES]; else { [_engine sendUpdate: [NSString stringWithFormat: @"Already Updated. %@", [NSDate date]]]; }
}
So basically in my example this never gets called, but in the demo it does. I'm confused as to what I might need to do to get this working. I'm wondering since the viewController is an IBOutlet in the app delegates header that I may have to do something in Interface Builder, but I'm not sure what.
Any help would be appreciated!!!