Skip to content

Commit

Permalink
Merge pull request #135 from kolinkrewinkel/master
Browse files Browse the repository at this point in the history
Use correct UI/NSResponder class in presponder (fixes #134)
  • Loading branch information
kastiglione committed Jan 5, 2016
2 parents 867b4e2 + 5326dc4 commit 5d3fb06
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions commands/FBPrintCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,14 @@ def args(self):

def run(self, arguments, options):
startResponder = arguments[0]
if not fb.evaluateBooleanExpression('(BOOL)[(id)' + startResponder + ' isKindOfClass:[UIResponder class]]') and not fb.evaluateBooleanExpression('(BOOL)[(id)' + startResponder + ' isKindOfClass:[NSResponder class]]'):
print 'Whoa, ' + startResponder + ' is not a UI/NSResponder. =('

isMac = runtimeHelpers.isMacintoshArch()
responderClass = 'UIResponder'
if isMac:
responderClass = 'NSResponder'

if not fb.evaluateBooleanExpression('(BOOL)[(id)' + startResponder + ' isKindOfClass:[' + responderClass + ' class]]'):
print 'Whoa, ' + startResponder + ' is not a ' + responderClass + '. =('
return

_printIterative(startResponder, _responderChain)
Expand Down

0 comments on commit 5d3fb06

Please sign in to comment.