I'm writing simple PyObjC application and I faced strange problem. I do development on 10.6 using Xcode (10.5 Base SDK) and also test it on my other 10.5 Mac. Everything works well on my machines, but some users complains, for example, I was using NSFormatters, this formatter worked fine on both of my machines:
def stringForObjectValue_(self, val):
def getObjectValue_forString_errorDescription_(self, v):
return (True, formatingFunction(v), None)
but I received complains from users, their crash report said "class MyFormatter(NSFormatter): objc.BadPrototypeError: Objective-C expects 4 arguments, Python argument has 2 arguments for ", but they were using 10.6.2 and their objc.__version__ was '2.2b3', same as on my 10.6 machine. It's obvious that "getObjectValue_forString_errorDescription_" should take 4 arguments(including self) but it didn't work with 4 arguments on my machine. I just get rid of NSFormatters to solve this issue.
The other thing, I needed to add Growl support, I created this wrapper:
def init(self, name):
self = super(GrowlWrapper, self).init()
self.name = name
bundle_path=objc.pathForFramework(os.path.dirname(sys.argv) + '/../Frameworks/Growl.framework'))
self._growl = GrowlApplicationBridge
def notify(self, title, description):
As usual everything was ok on my machines, but other users had problems, their crash report complained that GrowlWrapper.init takes 2 arguments instead of 1. I deleted additional argument - program didn't crash and worked fine except that it didn't show Growl popup, no messages on Console, however on my machines new GrowlWrapper worked fine. And right now I don't have any clue how to fix it.
How could all this happen if OS X versions and objc.__version__ are the same ?
My program released under GPL and is quite simple, I'd appreciate if someone could test it out and see what's wrong.