On iOS < 4.3 AFNetworking does not work when using the new class method addAcceptableStatusCodes because imp_implementationWithBlock is iOS 4.3+ only.
One way to solve this would be to use https://github.com/landonf/plblockimp for older iOS versions.
Thanks for pointing that out.
Going forward, iOS 4 support will become less of a requirement for projects since user adoption of new OSes is pretty rapid, so I'm perfectly alright supporting only 4.3 and above.I should update the documentation to make that an explicit requirement.
[Issue #320] Documenting iOS 4.3 minimum requirement for new metaprog…
Damn, I feared that you would say that. I'll implement a solution using plblockimp in my fork...
Unfortunately there are still too many users using iOS 4.2.1 to drop support in our app.
I'm with @tibr. Still see lots of clients asking for 4.2+ support.
I'm all for ditching 4.3 support (really, IMHO, it's time), but this would be really easy to accomplish without imp_implementationWithBlock; either the mutable set or the block itself could be associated (using associated objects) with the Class singleton instance, and the method could be swizzled in using a regular C function casted to an IMP.
EDIT (sorry, on mobile): And I don't mean to force this off on someone else, I'll demo an implementation of it in a pull request as soon as I get home. After all, I've got the blocks experience. ;-)
@zwaldowski If you can find a more compatible implementation to swap out, I'd love to see it. Just to clarify, though, 4.3 would be supported; 4.2 and under is what's at stake.
Well done, thanks @zwaldowski