I'm trying to get this code: http://code.google.com/p/switchcontrol/source/browse/trunk/code/AFSwitchControl.m compiling under Apple LLVM in Xcode 4.5.2. It works when compiled with LLVM/GCC, but crashes in the mouseDown method when switched to Apple LLVM on line 198:
NSRect knobRect = _AFSwitchControlKnobRectForInsetBackground(slotRect, _offset);
Because _offset is not set. It's suppose to be set in the bind method with this line:
[self setOffset:(CGFloat)[self state]];
But it appears that nothing is being set under LLVM for some reason. My binding call looks like:
[control bind:NSValueBinding toObject:self withKeyPath:@"isToggleSwitchOn" options:nil];
Any ideas why the control's state is not returning anything under LLVM? Thanks!