TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

AFNetworking: A Delightful Networking Library for iOS and Mac OS X

59 pointsby matttthompsonover 13 years ago

6 comments

nupark2over 13 years ago
I haven't reviewed the implementation, but the API alone appears to be a significant improvement over the previously available options.<p>However, the use of non-prefixed category methods (monkey-patching) is an inappropriate design choice, given the fact that the likelihood of conflict is actually higher than 0 when using non-prefixed category methods.<p>Let's say you were doing a gradual migration from ASIHTTP -- you'd have a non-deterministic conflict on the -[UIImageView setImageWithURL:] category method.<p>Unfortunately -- and despite repeated advisements to not do so by Apple engineers and others -- AFNetworking isn't the only library to add such a category method, and in fact, a number of libraries and third-party code add different, conflicting -[UIImageView setImageWithURL:] category methods. It's not too hard to wind up with a conflict.<p>Category methods should always be name-prefixed to avoid conflict, if you're going to use them at all:<p><pre><code> -[UIImageView af_setImageWithURL:]</code></pre>
评论 #3154824 未加载
gue5tover 13 years ago
This library is described as "Insanely Fast", and performance feats on various connection types are described.<p>Is the implication that it performs some optimization that regular sockets could not do? Or is it merely faster than some alternative? I don't know terribly much about the i* ecosystem, but it seems like speed should be the least distinctive attribute for networking libraries; providing a helpful abstraction is the real concern, and only by considerably folly or cleverness would performance differ noticeably.
评论 #3154555 未加载
pashieldsover 13 years ago
We've only experimented with converting over to AF, but the experience has been fairly pleasant. In particular, Mattt has been very receptive to talking a few things out with me and even sent me a follow up this morning when one of my complaints was fixed. Interacting with the community is important for this sort of project, and Mattt has a good start on that.
aaronbrethorstover 13 years ago
I've been using AFNetworking for a month or two, now, and I cannot say enough good things about it. Mattt isn't joking when he describes it as a 'delightful' library; it really is a joy to use, and the community that has sprung up around it is incredibly dedicated and <i>very</i> responsive to suggestions and bug reports.
pshapiroover 13 years ago
Anyone know how this library handles caching?
评论 #3154506 未加载
thinkbohemianover 13 years ago
Great work!