[Pyobjc-dev] depythonifying 'unsigned int', got 'NoneType'
Brought to you by:
ronaldoussoren
From: Michael B. <mi...@je...> - 2005-04-27 03:59:44
|
Hi, all! I'm working through the exercises in 'Cocoa Programming for Mac OS X' and well, I'm stumped. It seems that whenever self.employees.insertObject_atIndex_(p, index) is called by the NSArrayController (or at least that's how I think it works), it isn't passing the index value. Rather, it is passing None. The error displayed is "depythonifying 'unsigned int', got 'NoneType'". If I assign index an integer value, a record will be inserted but of course it has an invalid index. Can anyone point out what I'm doing wrong? (feel free to point out anything else I'm doing here that's dumb, too) Also, I keep getting the following error in the log even though setEmployees_() is not returning anything: KVO autonotifying only supports -set<Key>: methods that return void. Autonotifying will not be done for invocations of -[RaiseManDocument setEmployees:]. Any ideas? I've tried 'return None' with the same results... def init(self): self = super(RaiseManDocument, self).init() self.path = None self.employees = NSMutableArray.alloc().init() return self def setEmployees_(self, xarray): self.employees = xarray def insertObject_inEmployeesAtIndex_(self, p, index): undo = self.undoManager() undo.prepareWithInvocationTarget_(self).removeObjectFromEmployeesAtIndex _(index) if not undo.isUndoing(): undo.setActionName_(u"Insert Person") self.employees.insertObject_atIndex_(p, index) def removeObjectFromEmployeesAtIndex_(self, index): p = employees.objectAtIndex_(index) undo = self.undoManager() undo.prepareWithInvocationTarget_(self).insertObject_inEmployeesAtIndex_ (p, index) if not undo.isUndoing(): undo.setActionName_(u"Delete Person") self.employees.removeObjectAtIndex_(index) |