Re: [Pyobjc-dev] Subclassing from NibClassBuilder-generated files
Brought to you by:
ronaldoussoren
From: Jordan K. <jo...@kr...> - 2003-12-02 21:32:10
|
On 2-Dec-03, at 1:11 PM, Martina Oefelein wrote: > This doesn't rename the ObjC class 'Converter'. (Actually, AFAIK it > doesn't rename the python class either, it only makes the class > available under a new nickname) Yep. > You are trying to create a new class Converter, which inherits from > the existing Python/objc class Converter. Thus PyObjC tries to make > the new Python class also known to the objc runtime, but this fails > due the name conflict with the existing class: > >> objc.error: Class already exists in Objective-C runtime > > Contrary to Python classes, objc classes don't live in modules. On the > objc side, all classes live in a single namespace. > CurrencyConverter.Converter (also known as t._Converter) and > t.Converter would both map to the same objc class Converter. Gotcha. That's the part I was forgetting (haven't written any C-like stuff in years.. one gets spoiled). > If you just added one or two new actions in IB, it is probably not > worth to go re-run, you can just type in the new method name(s) by > hand. > > If you made a lot of changes in IB, re-running NibClassBuilder may > save some typing. For example, just let NibClassBuilder write the > class to stdout, and copy the new declarations from the terminal > window into your script. > > Note that the technique which you described wouldn't save you the > typing/copying, either (if it would work). You would have to type/copy > the same action names into your subclass... Yes, I just was trying to think of a non-lossy way to make changes in IB; having to add code for new stuff created in IB was a given, I just wasn't sure what else IB could affect, aside from outlets/actions. That's why I figured I'd ask here, 'cause every set of tools is used differently. Thanks! I guess I'll just keep on working as-is, and see what I come up with. J. |