Re: [Pyobjc-dev] Calling python from objc
Brought to you by:
ronaldoussoren
From: Akhar <ak...@gm...> - 2004-04-23 11:57:44
|
I was able to fix the script loading problem it was not due to that type which is in the email not the actual code. The problem I now have is with persistance of the python object. I am trying to have a customView call the python code programmatically so I inited pythonglue and my script in the init of the customView (no problem there ) but if I call it from the - keydown method it doesn't work ; I put a trace to see what the object's class were at init they are seen as the proper <PythonGlu> and <pyScript> but in - keydown are seen as (null). It looks like the objects are not retained somehow or something else is happenning and i do not know what. Any ideas? Cheers Stephane NB: I seem to have been able to fix my problem by taking out (pyScript) : %%%%%%%%%%%%%%%%%%%%%%%%%%%% ----Script.m, #import "Script.h" @implementation Script(pyScript) //<- offending line + instantiateSubclassNamed:(NSString*) aClassName { Class aClass = NSClassFromString(aClassName); return [[aClass alloc] init]; } @end BUT i do get another error which is : creating object *** -[scr test]: selector not recognized An uncaught exception was raised *** -[scr test]: selector not recognized *** Uncaught exception: <NSInvalidArgumentException> *** -[scr test]: selector not recognized QuickShell has exited due to signal 5 (SIGTRAP). %%%%%%%%%%%%%% passing nil from objective c code like "[scr test:nil];" solved the problem On 23-Apr-04, at 1:55 AM, Ronald Oussoren wrote: > > On 21-apr-04, at 1:40, Akhar wrote: >> >> Script = lookUpClass("Scipt") > > There's a typo in this line, the argument to lookUpClass is missing an > 'r'. > > Ronald > -- > X|support bv http://www.xsupport.nl/ > T: +31 610271479 F: +31 204416173 |