1) Obtain MenuEdit source
2) change dependency on 10.4 SDK to "Current OS" (I'm on 10.6.6) for convenience
3) Compile and run (i386 active arch)
4) Observe no Window for Menu edit appears
5) Console logs:
2011-02-11 01:49:34.816 MenuEdit[10084:a0b] *** -[NSCFArray objectAtIndex:]: index (-1 (or possibly larger)) beyond bounds (162)
2011-02-11 01:49:34.867 MenuEdit[10084:a0b] *** -[NSCFArray objectAtIndex:]: index (-1 (or possibly larger)) beyond bounds (162)
2011-02-11 01:49:59.969 MenuEdit[10084:a0b] *** -[NSCFArray objectAtIndex:]: index (-2 (or possibly larger)) beyond bounds (162)
exception back trace excerpt:
bounds (162)' that raised inside Carbon event dispatch
(
0 CoreFoundation 0x998c46ba __raiseError + 410
1 libobjc.A.dylib 0x9398d509 objc_exception_throw + 56
2 CoreFoundation 0x998c43e8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x998c435a +[NSException raise:format:] + 58
4 Foundation 0x994f42cc _NSArrayRaiseBoundException + 121
5 Foundation 0x99447f3a -[NSCFArray objectAtIndex:] + 63
6 MenuEdit 0x0000482b -[MyDocument setViewOptions:withThemeObject:] + 621
7 MenuEdit 0x00004791 -[MyDocument setViewOptions:withThemeObject:] + 467
8 MenuEdit 0x000033cc -[MyDocument awakeFromNib] + 779
proposed fix / patch attached
fix explanation:
while an attempt is made to set local var "property" to nil at the end of a loop, the var is declared inside the loop and not intialized. Declaration without initialization is not guaranteed to be intialized to nil. Setting to nil at end of loop won't affect new declaration on next pass.
It is best to declare variables outside the loop.
patch to fix invalid array index exception