【问题标题】:Iphone - Twitter log out using MGTwitterEngine [duplicate]Iphone - Twitter 使用 MGTwitterEngine 注销 [重复]
【发布时间】:2011-06-15 13:56:48
【问题描述】:

我正在使用 MGTwitterEngine 在 iPhone 应用程序上集成 Twitter。

如何注销当前用户?

【问题讨论】:

    标签: iphone twitter logging mgtwitterengine out


    【解决方案1】:

    对于注销使用这些行,其中 self._engine 是 SA_OAuthTwitterEngine 的对象

    • (void) ourLogoutMethod
      {
      [self._engine setClearsCookies:YES];
      [self._engine clearAccessToken];

      NSHTTPCookie *cookie;
      NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
      for (cookie in [storage cookies])
      {
          NSString* domainName = [cookie domain];
          NSRange domainRange = [domainName rangeOfString:@"twitter"];
          if(domainRange.length > 0)
          {
              [storage deleteCookie:cookie];
          }
       }
      

    }

    【讨论】:

      【解决方案2】:

      您需要访问 - (void)setUsername:(NSString *)newUsername password:(NSString *)newPassword GMTwitterEngine 类中的方法。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-09-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-29
        • 2011-09-08
        • 1970-01-01
        • 2011-05-08
        相关资源
        最近更新 更多