Formal protocols should work just fine. Is MGScopeBarController a formal protocol? If you want to create a class that implements the formal protocol you need to do something like this:
class MyBar (NSObject, MGScopeBarController):
pass
Could you provide a small self-contained example that shows the problem? I don't mind if I have to download a framework, but at least provide all python code that's needed to reproduce the problem.
What version of PyObjC are you using?
And to answer your latest question: you have to create informal protocol specifications, but only for methods where not all arguments are objects or where the result is not either "void" or an object. The Foundation.protocols module you mention is an example of that, although later versions of PyObjC use an XML based description file.
Ronald
On Friday, April 24, 2009, at 12:14PM, "Johan Rydberg" <joh...@gm...> wrote:
>I changed my framework so that it uses informal protocols instead.
>Do I have to create informal protocol specifications for PyObjC, like these?
>
>http://svn.red-bean.com/pyobjc/branches/pyobjc-1.4-branch/Lib/Foundation/protocols.py
>
>On Thu, Apr 23, 2009 at 11:10 PM, Johan Rydberg <joh...@gm...> wrote:
>> I try to implement a format protocol in python. Everything works fine
>> as long as my class only
>> has methods that are defined by the protocol. When I extend my class
>> with something else,
>> I get an error:
>>
>> class MasterListScopeBar(MGScopeBarController):
>> objc.internal_error: PyObjCClass_BuildClass: Cannot fetch key in keylist
>>
>> For example, if I add a awakeFromNib method this happens.
>>
>> Why is this?
>>
>
>------------------------------------------------------------------------------
>Crystal Reports - New Free Runtime and 30 Day Trial
>Check out the new simplified licensign option that enables unlimited
>royalty-free distribution of the report engine for externally facing
>server and web deployment.
>http://p.sf.net/sfu/businessobjects
>_______________________________________________
>Pyobjc-dev mailing list
>Pyo...@li...
>https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>
>
|