Re: [Pyobjc-dev] More on integer values
Brought to you by:
ronaldoussoren
From: David E. <epp...@ic...> - 2003-02-03 02:08:29
|
On 2/2/03 7:52 PM -0500 Bob Ippolito <bo...@re...> wrote: > On Sunday, Feb 2, 2003, at 19:46 America/New_York, David Eppstein wrote: > >> I just hit an error in my code; looks like the following scenario >> happened: >> 1. My code passed an integer value to >> undoManager.prepareWithInvocationTarget_ >> 2. I invoked an undo. >> 3. undoManager called my code with an NSCFInteger in place of the >> integer >> (so far, no problem...) >> 4. my code used that value as the column parameter of >> NSTableView.editColumn_row_withEvent_select_ >> 5. TypeError: expected an integer for argument 1: its typespec is 'i12' >> >> As usual, the workaround is to wrap the value in an int(), but >> shouldn't an objc integer be allowed to be used for this typespec? > > Well, from ObjC I would say no, if it expects an integer, it should get > an int. int and NSNumber aren't interchangable on the ObjC side of > things. If they're not interchangeable, then maybe it's a bug that calling into and back from the undo manager is changing my ints into integers? The point is, I'm passing it arguments that should work, and it's giving me back ones that don't work. -- David Eppstein UC Irvine Dept. of Information & Computer Science epp...@ic... http://www.ics.uci.edu/~eppstein/ |