[Pyobjc-dev] problem with NSTableView
Brought to you by:
ronaldoussoren
From: chris b. <por...@ya...> - 2003-03-13 19:56:45
|
Hello, I'm currently experiencing an error with my program which lead to the following getting outputted to the console 2003-03-07 21:14:33.618 whisper[508] Application did finish launching. 2003-03-07 21:15:09.902 whisper[508] *** Assertion failure in -[NSTableView _locationOfRow:], TableView.subproj NSTableView.m:486 2003-03-07 21:15:10.028 whisper[508] NSInternalInconsistencyException I haven't actually been able to find the _locationOfRow: method in any of Apple's documentation or the web. I guess it must be a private call to do with the way that the object renders itself to screen. So if any of you know what this actually is so I can figure out what is going wrong that would be very useful. I'm programming in Python and bridging to Cocoa with the PyObjC module (version 0.8). This NSTableView instance is pure Obj-C and was created via Interface builder. The error occurs when setting the datasource of the NSTableView object using the following Python code. self.knownEntitiesTable.setDataSource_(self.knownEntities) self.knownEntities is a Python object that inheriting from NSObject and implementing the informal NSTableDataSource protocol. At this point it contains no data to display as I'm just setting the program up at this point. Any help that you can give would be greatly appreciated. Thanks in advance. Chris here is the python code of the knownEntities Object that acts as the datasource. class entityTable(NSObject): identitiesList = [] counter = 0 def numberOfRowsInTableView_(self): NSLog(str(self.counter)) return self.counter def tableView_objectValueForTableColumn_row_(self, tableView, tableColumn, row): NSLog(self.identitiesList[row].name) return self.identitiesList[row].name def tableView_setObjectValue_forTableColumn_row_(self, tableView, id, tableColumn, row): self.identitiesList.insert(row,id) def setIdentity(self,id,row): if row < len(self.identities): self.identitiesList[row] = id else: self.identitiesList.append(id) self.counter += 1 def setIdentities(self,ids): self.counter = len(ids) self.identitiesList = ids def getIdentity(self,row): return self.identitiesList[row] def getIdentities(self): return self.identitiesList def append(self,id): self.counter += 1 self.identitiesList.append(id) #it has been very insistent about these two methods def __len__(self): return self.counter def __getitem__(self, key): return self.identitiesList[key] __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com |