Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid infinite recursion in UITextInputTraits_valueForKey(). Fixes #22

  • Loading branch information...
commit aac1a8a82a9561aa1cef7b954183ebd096ccc857 1 parent 08cc934
@0xced authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 DCIntrospect/DCIntrospect.m
View
4 DCIntrospect/DCIntrospect.m
@@ -103,7 +103,9 @@ + (void)workaroundUITextInputTraitsPropertiesBug
{
IMP originalValueForKey = class_replaceMethod(class, @selector(valueForKey:), (IMP)UITextInputTraits_valueForKey, valueForKeyTypeEncoding);
if (!originalValueForKey)
- originalValueForKey = class_getMethodImplementation([class superclass], @selector(valueForKey:));
+ originalValueForKey = [objc_getAssociatedObject([class superclass], originalValueForKeyIMPKey) pointerValue];
+ if (!originalValueForKey)
+ originalValueForKey = class_getMethodImplementation([class superclass], @selector(valueForKey:));
objc_setAssociatedObject(class, originalValueForKeyIMPKey, [NSValue valueWithPointer:originalValueForKey], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
Please sign in to comment.
Something went wrong with that request. Please try again.