Remove button / undo not working


#1

I am having some trouble with the undo code:

My program runs… it was crashing due to the autosave but now it runs however my Remove button does not work… and thus neither does my undo/redo function.

My output log looks like this:

GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 8 20:32:45 UTC 2011) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys000 [Switching to process 45522 thread 0x0] 2011-12-20 13:46:13.285 RaiseMan[45522:707] adding <Person: 0x10018dcf0> to ( ) 2011-12-20 13:46:14.806 RaiseMan[45522:707] removing <Person: 0x10018dcf0> from ( "<Person: 0x10018dcf0>" ) 2011-12-20 13:46:14.808 RaiseMan[45522:707] *** -[NSProxy doesNotRecognizeSelector:insertObject:atIndex:] called! 2011-12-20 13:46:14.814 RaiseMan[45522:707] ( 0 CoreFoundation 0x00007fff92bff286 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff8ea92d5e objc_exception_throw + 43 2 CoreFoundation 0x00007fff92bff0ba +[NSException raise:format:arguments:] + 106 3 CoreFoundation 0x00007fff92bff044 +[NSException raise:format:] + 116 4 Foundation 0x00007fff933e9d02 -[NSProxy doesNotRecognizeSelector:] + 61 5 CoreFoundation 0x00007fff92bec133 ___forwarding___ + 371 6 CoreFoundation 0x00007fff92bebf48 _CF_forwarding_prep_0 + 232 7 RaiseMan 0x00000001000011ce -[RMDocument removeObjectFromEmployeesAtIndex:] + 222 8 Foundation 0x00007fff933b4079 -[NSKeyValueNotifyingMutableArray removeObjectAtIndex:] + 130 9 AppKit 0x00007fff94ceb4f0 -[NSArrayDetailBinder _performArrayBinderOperation:singleObject:multipleObjects:singleIndex:multipleIndexes:selectionMode:] + 897 10 AppKit 0x00007fff94ceb074 -[NSArrayDetailBinder removeObjectFromMasterArrayRelationshipAtIndex:selectionMode:] + 46 11 AppKit 0x00007fff94ce78b6 -[NSArrayController _removeObjectAtArrangedObjectIndex:objectHandler:] + 264 12 AppKit 0x00007fff94ce6a95 -[NSArrayController remove:] + 159 13 CoreFoundation 0x00007fff92beea1d -[NSObject performSelector:withObject:] + 61 14 AppKit 0x00007fff94b2a710 -[NSApplication sendAction:to:from:] + 139 15 AppKit 0x00007fff94b2a642 -[NSControl sendAction:to:] + 88 16 AppKit 0x00007fff94b2a56d -[NSCell _sendActionFrom:] + 137 17 AppKit 0x00007fff94b29a30 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2014 18 AppKit 0x00007fff94ba98e0 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 489 19 AppKit 0x00007fff94b2863a -[NSControl mouseDown:] + 786 20 AppKit 0x00007fff94af30e0 -[NSWindow sendEvent:] + 6306 21 AppKit 0x00007fff94a8b68f -[NSApplication sendEvent:] + 5593 22 AppKit 0x00007fff94a21682 -[NSApplication run] + 555 23 AppKit 0x00007fff94ca080c NSApplicationMain + 867 24 RaiseMan 0x0000000100000ec2 main + 34 25 RaiseMan 0x0000000100000e94 start + 52 )

So I assume there is some problem with my insertObject or removeObject methods but I cant find anything obvious like a miss-spelling.

How do I find exactly where I am having a problem from the above output?

I have attached the project code here: http://sharesend.com/sqwcf


#2

The issue is that this line:

should be this:

It might help to turn on the exception breakpoint (p. 60) - that way the debugger will show you the line the problem occurs on.

Adam


#3

Thanks Adam,

I actually found my mistake a bit later looking through the code again.