Twitter+OAuth第三方如何实现

How to implement Twitter+OAuth third party

我一直在测试使用 Twitter+OAuth 第三方下载实现 Twitter 登录:https://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master/Twitter%2BOAuth

此代码段用于实例化 SA_OAuthTwitterEngine。

SA_OAuthTwitterEngine *engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate: self];

但是,如果这个实例化是在NSObject的子类中实现的(不是在UIViewController中:因为Twitter+OAuth中的演示打算在UIViewController中实例化"viewWillAppear"),你将无法实例化全部.

*engine 和 self 将为 nil,这在这种情况下是不正确的行为。 综上所述,我想做的是在 NSObject 的子类中使用这个第三方实现 Twitter 登录。

请尽快帮我解决这个问题。

干杯,

你不应该在新项目中使用 Twitter+OAuth; iOS 从 iOS 5 开始就包含内置的 Twitter 支持;这就是应该使用的。