Ronald Oussoren wrote:
There was a case where I had to decorate a couple of functions with @objc.accessor or I got the same kind of no-error crash. Is it the same cause? Is there a way to know when I need to use that vs not?
>
That depends on the method names you're using. "Regular" accessors ("setFoo_" and "foo") should work without an objc.accessor decorator.


The methods aren't of that form, because they're not really accessor methods as far as I understand it. The problem only occurs when I include:

def someMethod_(...)
  #code...
  undo = self.undoManager()
  undo.prepareWithInvocationTarget_(self).someReverseMethod_(p, i)
  #code...

If I don't add @objc.accessor to someMethod_() and someReverseMethod_() I get the unexplained crash. Those methods *do* modify an instance variable (directly); is that why they require the accessor decorator?


dan

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to