[Pythonmac-SIG] [Pyobjc-dev] another tableview question

Ronald Oussoren ronaldoussoren at mac.com
Fri Jul 8 10:45:15 CEST 2005


 
On Friday, July 08, 2005, at 06:40AM, Bob Ippolito <bob at redivi.com> wrote:

>
>On Jul 7, 2005, at 6:10 PM, Dethe Elza wrote:
>
>>
>> On 7-Jul-05, at 7:29 PM, Phil Christensen wrote:
>>
>>>     def numberOfRowsInTableView_(self, sender):
>>>         return (len(self.contents))
>>>     numberOfRowsInTableView_ = objc.selector 
>>> (numberOfRowsInTableView_,
>>>                                              argumentTypes='O',
>>>                                              returnType='i')
>>
>> I have never needed to use objc.selector.  I think this method should
>> be OK without it.
>
>Since the types are specified by an existing class in the runtime,  
>you definitely don't need or want to specify something else.  The  
>objc.selector(...) is actually breaking things, because you can't  
>just pull type codes out of your ass and expect it to do the right  
>thing.  'O' doesn't mean object, '@' does.\

This is actually correct, although it could be said that the functionality sucks :-(

The argumentTypes and returnType arguments of selector get PyArg_Parse-style
type specifiers. I wouldn't be surprised if this code is barely tested, I never used
the functionality although it looked like a great idea at the time.

>
>>> #################################
>>>
>>> but when I run the application I get:
>>>
>>> 2005-07-07 22:19:30.911 controller[7740] *** Illegal NSTableView
>>> data source (<ContentsTreeViewDelegate: 0x11ac760>).  Must
>>> implement numberOfRowsInTableView: and
>>> tableView:objectValueForTableColumn:row:
>
>I think this is because you're using bogus type codes.  Don't use  
>objc.selector unless you need to AND know what you're doing ;)
>
>-bob
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
>July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
>core and dual graphics technology at this free one hour event hosted by HP, 
>AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
>_______________________________________________
>Pyobjc-dev mailing list
>Pyobjc-dev at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>
>


More information about the Pythonmac-SIG mailing list