PyObjC IVar存取器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PyObjC IVar存取器相关的知识,希望对你有一定的参考价值。
Placing these inside a PyObjC class lets you access PyObjC instance variables starting with '_' without extra work while still allowing access to standard Python instance variables.
def __getattr__(self, name): if name[0] == '_': return objc.getInstanceVariable(self, name) else: return self.__dict__[name] def __setattr__(self, name, value): if name[0] == '_': return objc.setInstanceVariable(self, name, value, 1) else: self.__dict__[name] = value return value
以上是关于PyObjC IVar存取器的主要内容,如果未能解决你的问题,请参考以下文章