Skip to content

Commit

Permalink
Fix IMP type in valueForKey for UITextInput. Fixes #76.
Browse files Browse the repository at this point in the history
  • Loading branch information
adjohnson916 authored and Anders D. Johnson committed Jun 16, 2015
1 parent 9555122 commit 9dabc0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DCIntrospect/DCIntrospect.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ id UITextInputTraits_valueForKey(id self, SEL _cmd, NSString *key)
free(properties);
}

IMP valueForKey = (IMP)[objc_getAssociatedObject([self class], originalValueForKeyIMPKey) pointerValue];
// See https://github.com/kstenerud/ObjectAL-for-iPhone/issues/73#issuecomment-64778814
// See http://stackoverflow.com/questions/2650190/objective-c-and-use-of-sel-imp
id (*valueForKey)(id, SEL, NSString*) = (id (*)(id, SEL, NSString*))[objc_getAssociatedObject([self class], originalValueForKeyIMPKey) pointerValue];
if ([textInputTraitsProperties containsObject:key])
{
id textInputTraits = valueForKey(self, _cmd, @"textInputTraits");
Expand Down

0 comments on commit 9dabc0b

Please sign in to comment.