views:

93

answers:

0

I have two projects that include the same code:

 NSButton *button = [[NSButton alloc] initWithFrame:ctrlRect];

(gdb) print (int)[button state] $1 = 1

in the other project $1 = 0

I am compiling both with GCC 4.2, 10.6 - no other apparent differences in compiler settings.

If I alloc/init an NSButton earlier in the app, state = 0 which implies that something is clobbering memory. I've turned on guard malloc, prescribble, etc but am not seeing any warnings.

Any clues or thoughts on debugging?