MacNN Forums (http://forums.macnn.com/)
-   Developer Center (http://forums.macnn.com/developer-center/)
-   -   Why does this code crash when compiled with Apple LLVM, but not in GCC? (http://forums.macnn.com/79/developer-center/504233/why-does-code-crash-when-compiled/)

 
timmerk Sep 21, 2013 12:02 AM
Why does this code crash when compiled with Apple LLVM, but not in GCC?
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!
 
All times are GMT -4. The time now is 04:37 AM.

Copyright © 2005-2007 MacNN. All rights reserved.
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2015, vBulletin Solutions, Inc.


Content Relevant URLs by vBSEO 3.3.2