您认为哪个 OAuth 库最适合 Objective-C/iPhone? [英] Which OAuth library do you find works best for Objective-C/iPhone?

查看:14
本文介绍了您认为哪个 OAuth 库最适合 Objective-C/iPhone?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直希望将我的 Twitter 集成代码切换到 OAuth,现在还有不到 7 周的截止日期(请参阅倒计时链接),因此跳转到 OAuth 变得更加重要.我一直在做非常简单的基本身份验证.不幸的是,OAuth 似乎不是我在几个小时内就能搞定的东西.

I have been looking to switch to OAuth for my Twitter integration code and now that there is a deadline in less than 7 weeks (see countdown link) it is even more important to make the jump to OAuth. I have been doing Basic Authentication which is extremely easy. Unfortunately OAuth does not appear to be something that I would whip together in a couple of hours.

http://www.countdowntooauth.com/

所以我想使用图书馆.我整理了以下清单.

So I am looking to use a library. I have put together the following list.

  • MPOAuth
  • MGTwitterEngine
  • OAuth 消费者

我看到 MPOAuth 有一些很棒的功能,有大量的测试代码,但有一个大问题.这是行不通的.应该通过 Twitter 进行身份验证的示例 iPhone 项目导致了其他人已识别并记录为错误的错误.

I see that MPOAuth has some great features with a good deal of testing code in place but there is one big problem. It does not work. The sample iPhone project that is supposed to authenticate with Twitter causes an error which others have identified and logged as a bug.

http://code.google.com/p/mpoauthconnection/问题/细节?id=29

最后一次代码更改是在 3 月 11 日,这个 bug 是在 3 月 30 日提交的.已经一个多月了,这个严重的 bug 还没有修复.所以我已经转向 MGTwitterEngine.

The last code change was March 11 and this bug was filed on March 30. It has been over a month and this critical bug has not been fixed yet. So I have moved on to MGTwitterEngine.

我拉下源代码并将其加载到 Xcode 中.我立即发现有一些依赖项,并且 README 文件没有明确的步骤列表来获取这些依赖项并将它们与项目集成,以便成功构建.我认为这表明该项目在黄金时段还不够成熟.我还看到,当一个库就足够了时,该项目引用了 2 个 JSON 库.一个是 TouchJSON,它对我来说效果很好,所以我再次不鼓励在我的应用程序中依赖这个项目.

I pulled down the source code and loaded it up in Xcode. Immediately I find that there are a few dependencies and the README file does not have a clear list of steps to fetch those dependencies and integrate them with the project so that it builds successfully. I see this as a sign that the project is not mature enough for prime time. I see also that the project references 2 libraries for JSON when one should be enough. One is TouchJSON which has worked well for me so I am again discouraged from relying on this project for my applications.

我确实发现 MGTwitterEngine 使用了 OAuthConsumer,OAuthConsumer 是由 Google 代码上的 OAuth 项目托管的众多 OAuth 项目之一.

I did find that MGTwitterEngine makes use of OAuthConsumer which is one of many OAuth projects hosted by an OAuth project on Google Code.

乍一看,OAuthConsumer 似乎是一个不错的选择.它与其他 OAuth 库一起托管,并有一些很好的文档.我拉下代码,它构建没有错误,但它确实有很多警告.当我在 Xcode 3.2 中运行新的构建和分析功能时,我看到 50 个分析器结果.许多被标记为潜在的内存泄漏,这可能会导致使用此库的任何应用程序不稳定.

It looks like OAuthConsumer is a good choice at first glance. It is hosted with other OAuth libraries and has some nice documentation with it. I pulled down the code and it builds without errors but it does have many warnings. And when I run the new Build and Analyze feature in Xcode 3.2 I see 50 analyzer results. Many are marked as potential memory leaks which would likely lead to instability in any app which uses this library.

似乎没有明显的赢家,我必须在 Twitter OAuth 的大截止日期之前采取一些措施.

It seems there is no clear winner and I have to go with something before the big Twitter OAuth deadline.

有什么建议吗?

推荐答案

我用过 begottlieb 的 Twitter-OAuth 没有问题.

I've used bengottlieb's Twitter-OAuth without issues.

Build+Analyse 仅发现一个问题(在 SA_OAuthTwitterController.m 中),并且这只是一个变量,该变量在初始化期间存储了一个永远不会读取的值.我在使用它时没有看到任何泄漏.它实施起来很简单,到目前为止(商店中有两个应用在使用它,第三个正在开发中)完全没有问题.

Build+Analyse finds only one issue (in SA_OAuthTwitterController.m) and that's just a variable that has a value stored during initialization that is never read. I've not seen any leaks in my use of it. It was simple to implement and so far (two apps in the store using it, a third in development) no problems at all.

这篇关于您认为哪个 OAuth 库最适合 Objective-C/iPhone?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆