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