Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
objc nil?
-
in the beta ctypes/objc_utils module, is there a way to send
nil
as a selector argument? i was trying to uselocationOfTouch_inView_
with anil
view, but none ofNone
,ns(None)
,ObjCInstance(0)
worked. -
None
should work. What happens when you pass that? I have a suspicion that this might be related to 32/64-bit again... -
I just tried this on a first-gen iPad mini (32-bit), and it worked fine, so 32/64-bit is probably not the issue here.
To test it, I've put this code in the [MapView Example]'s
long_press
method:# ... def long_press(self, sender): touch_loc = self.recognizer.locationOfTouch_inView_(0, None) print touch_loc.x, touch_loc.y # ...
Perhaps you're passing something invalid for the
touch
parameter? Note that not all gesture recognizers actually track multiple touches; the maximum value should berecognizer.numberOfTouches() - 1
, wherenumberOfTouches()
returns the number of touches that actually participate in the gesture (while there might be other touches on the screen).