Skip to content

imp_implementationWithBlock() is not supported below iOS 4.3 #320

Closed
tibr opened this Issue Apr 27, 2012 · 8 comments

4 participants

@tibr
tibr commented Apr 27, 2012

On iOS < 4.3 AFNetworking does not work when using the new class method addAcceptableStatusCodes because imp_implementationWithBlock is iOS 4.3+ only.

@tibr
tibr commented Apr 27, 2012

One way to solve this would be to use https://github.com/landonf/plblockimp for older iOS versions.

@mattt
mattt commented Apr 27, 2012

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.

@mattt mattt closed this Apr 27, 2012
@mattt mattt added a commit that referenced this issue Apr 27, 2012
@mattt mattt [Issue #320] Documenting iOS 4.3 minimum requirement for new metaprog…
…ramming functions
c77a001
@tibr
tibr commented Apr 27, 2012

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.

@kcharwood

I'm with @tibr. Still see lots of clients asking for 4.2+ support.

@zwaldowski

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.

@zwaldowski

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. ;-)

@mattt
mattt commented Apr 28, 2012

@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.

@tibr
tibr commented May 2, 2012

Well done, thanks @zwaldowski

@greghe greghe pushed a commit to skillz/AFNetworking that referenced this issue Sep 3, 2015
@mattt mattt [Issue #320] Documenting iOS 4.3 minimum requirement for new metaprog…
…ramming functions
b342e4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.