Skip to content

Commit

Permalink
Revert "As ugly as it looks, only attempt to check for imp_implementa…
Browse files Browse the repository at this point in the history
…tionWithBlock on the 4.3 SDK and up."

This reverts commit f4efa63.
  • Loading branch information
zwaldowski committed Feb 7, 2012
1 parent f4efa63 commit 128e70f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions A2BlockDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
// Forward Declarations
extern char *a2_property_copyAttributeValue(objc_property_t property, const char *attributeName);
extern char *property_copyAttributeValue(objc_property_t property, const char *attributeName);

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_3
extern IMP imp_implementationWithBlock(void *block) __attribute__((weak_import));
#endif

@interface NSObject ()

Expand Down Expand Up @@ -267,15 +264,13 @@ static BOOL a2_resolveInstanceMethod(id self, SEL _cmd, SEL selector)

if (argc == 1)
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_3
if (imp_implementationWithBlock != NULL)
{
implementation = imp_implementationWithBlock([[^(NSObject *obj, id block) {
[[obj dynamicDelegateForProtocol: protocol] implementMethod: representedSelector withBlock: block];
} copy] autorelease]);
}
else
#endif
{
implementation = (IMP) a2_blockPropertySetter;
}
Expand All @@ -284,15 +279,13 @@ static BOOL a2_resolveInstanceMethod(id self, SEL _cmd, SEL selector)
}
else
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_3
if (imp_implementationWithBlock != NULL)
{
implementation = imp_implementationWithBlock([[^id (NSObject *obj) {
return [[obj dynamicDelegateForProtocol: protocol] blockImplementationForMethod: representedSelector];
} copy] autorelease]);
}
else
#endif
{
implementation = (IMP) a2_blockPropertyGetter;
}
Expand Down

0 comments on commit 128e70f

Please sign in to comment.