코드에 http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master을 구현하려고합니다. 제공된 데모를 따르고 있으며 제대로 작동하지 않는 것 같습니다. 여기에 문제가 현재 있다고 생각합니다.Twitter + OAuth + iPhone = fustration
애플 대리자 헤더 :
#import <uikit/uikit.h>
@class OAuthTwitterDemoViewController;
@interface OAuthTwitterDemoAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
OAuthTwitterDemoViewController *viewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet OAuthTwitterDemoViewController *viewController;
@end
응용 위임 IMPL :
은 그래서 예과 같이 헤더 응용 프로그램 위임의 OAuth를 연결 등을 처리하는 뷰 컨트롤러를 선언@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
화살표가 어디에 있는지 알 수 있습니다. 우리는 initWithNib 나 plain init을 결코하지 않습니다. 단지 창에보기 만 추가하면됩니다.
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]]];
}
}
하지만 데모는 않습니다 다음의 ViewController에 호출되는 무엇
이다. 나는이 일을하기 위해 내가해야 할 일이 무엇인지 혼란 스럽다. viewController는 인터페이스 작성기에서 뭔가를해야 할 수도있는 응용 프로그램 대리자 머리글의 IBOutlet이므로 궁금합니다.하지만 확실하지 않습니다.
도움이 될 것입니다!
twitter oauth의 서명은 무엇입니까? – GameLoading