Re: [Pyobjc-dev] How do I get NSTimer to call a python method?
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-06-25 15:40:41
|
(Sorry for the faulty repeat of Ronald's followup -- I'm on a ****slow**** connection.) First, change the class name 'ircController' to 'IRCController' -- it follows the Obj-C pattern and will reduce confusion (in that ircController in the code below really should be ircController). I also noticed that you are using multiple inheritance... class ircController(NibClassBuilder.AutoBaseClass, irclib.irc): .... but are initializing the irclib stuff in your connect method ... def connect_(self, sender): irclib.irc.__init__(self) ... and would suggest an implementation pattern change to make the code fall more in line with Model-View-Controller. Specifically, create an instance of irclib.irc and store it as an instance variable within your IRCConnection instance. If the end result works-- it should just as what you tried by adding the argument should work (I think)-- then there would appear to be a bug in the bridge related to multiple inheritance? b.bum On Wednesday, Jun 25, 2003, at 02:51 US/Pacific, Kevin Marks wrote: > On Wednesday, June 25, 2003, at 02:39 AM, Ronald Oussoren wrote: >> >> Use 'def idle_(self, sender):', the colon at the end of the ObjC >> method name indicated that the method has an argument. > > that didn't help; > > 2003-06-25 02:46:40.712 iirc[2460] *** -[ircController idle:]: > selector not recognized > 2003-06-25 02:46:40.712 iirc[2460] *** NSTimer ignoring exception > 'NSInvalidArgumentException' (reason '*** -[ircController idle:]: > selector not recognized') that raised during posting of timer with > target 9057f0 and selector 'idle:' > > Omitting the argument and the colon gives: > > 2003-06-25 02:50:30.239 iirc[2464] *** -[ircController idle]: selector > not recognized > 2003-06-25 02:50:30.239 iirc[2464] *** NSTimer ignoring exception > 'NSInvalidArgumentException' (reason '*** -[ircController idle]: > selector not recognized') that raised during posting of timer with > target 9057f0 and selector 'idle' > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting > Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly > Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |