Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Why does this code crash when compiled with Apple LLVM, but not in GCC?

Why does this code crash when compiled with Apple LLVM, but not in GCC?
Thread Tools
timmerk
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Sep 21, 2013, 12:02 AM
 
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!
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:52 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,