IB crash with custom binding
IB crash with custom binding
- Subject: IB crash with custom binding
- From: Ricky Sharp <email@hidden>
- Date: Wed, 23 Feb 2005 14:13:16 -0600
I added a custom 'baseColor' binding to my IIBackground object (subclass os NSView). I used the Joystick sample as a starting point [1].
I modified my IIWidgets palette (of which IIBackground is one item) to add all the appropriate APIs to support bindings. As a test, I created a new Cocoa application nib (10.2 and later format, 10.3 minimum OS) and dragged over an IIBackground and NSColorWell. I then bound the background's baseColor and the color well's value to a user defaults controller. I then saved this nib.
BTW, this is all under 10.3.8 with Xcode 1.5.
Testing the interface works a-ok. As expected, changing the value of the color well ultimately modifies the base color of my background object.
On occasion, when I quit IB, it will crash:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000020
Thread 0 Crashed:
0 libobjc.A.dylib 0x908311ec objc_msgSend + 0xc
1 com.apple.Foundation 0x90a93438 _NSKeyValueObservationInfoGetForwarderForObserver + 0x78
2 com.apple.Foundation 0x90a95f68 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 0x7c
3 com.apple.AppKit 0x931d98ac -[NSController removeObserver:forKeyPath:] + 0xb8
4 com.apple.AppKit 0x931b9348 -[NSBinder _updateObservingRegistration:] + 0x190
5 com.apple.AppKit 0x931bb070 -[NSBinder releaseConnection] + 0x34
6 com.apple.AppKit 0x931c4610 -[NSValueBinder releaseConnection] + 0x48
7 com.apple.AppKit 0x92e1b44c -[NSObject(_NSBindingAdaptorAccess) _releaseBindingAdaptor] + 0xd8
8 com.apple.AppKit 0x92e08138 __NSViewDeallocAuxiliary + 0x174
9 com.apple.AppKit 0x92de65a4 -[NSView _finalize] + 0x294
10 com.apple.AppKit 0x92e1f088 -[NSView dealloc] + 0x30
11 com.apple.AppKit 0x92e5ad50 -[NSControl dealloc] + 0x60
12 com.apple.AppKit 0x9303a6a0 -[NSColorWell dealloc] + 0x58
13 com.apple.AppKit 0x92dc73c4 -[NSView release] + 0xf0
14 com.apple.Foundation 0x909f7184 _nsnote_callback + 0xb0
15 com.apple.CoreFoundation 0x901aa5c0 __CFXNotificationPost + 0x1b4
16 com.apple.CoreFoundation 0x901aefd0 _CFXNotificationPostNotification + 0x340
17 com.apple.Foundation 0x909f4fd0 -[NSNotificationCenter postNotificationName:object:userInfo:] + 0x74
18 com.apple.AppKit 0x92e6a7ac -[NSWindow _close] + 0x64
19 com.apple.AppKit 0x92ec1780 -[NSWindow close] + 0x28
20 com.apple.Foundation 0x909f707c -[NSArray makeObjectsPerformSelector:withObject:] + 0x108
21 com.apple.AppKit 0x92ec1f78 -[NSApplication _deallocHardCore:] + 0xa8
22 com.apple.AppKit 0x92eae99c -[NSApplication terminate:] + 0x1c4
23 com.apple.InterfaceBuilder 0x00037794 0x1000 + 0x36794
24 com.apple.AppKit 0x92e78224 -[NSApplication sendAction:to:from:] + 0x6c
25 com.apple.AppKit 0x92eada44 -[NSMenu performActionForItemAtIndex:] + 0x188
26 com.apple.AppKit 0x92ef22e4 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 0x68
27 com.apple.AppKit 0x92ef8c14 -[NSMenu performKeyEquivalent:] + 0x104
28 com.apple.AppKit 0x92ed7ccc -[NSApplication _handleKeyEquivalent:] + 0x124
29 com.apple.AppKit 0x92df53dc -[NSApplication sendEvent:] + 0xa5c
30 com.apple.InterfaceBuilder 0x00010690 0x1000 + 0xf690
31 com.apple.AppKit 0x92dfdc54 -[NSApplication run] + 0x240
32 com.apple.InterfaceBuilder 0x00017780 0x1000 + 0x16780
33 com.apple.InterfaceBuilder 0x00036914 0x1000 + 0x35914
34 dyld 0x8fe1a558 _dyld_start + 0x64
Sometimes, IB will crash several times in a row. Other times, I can't get the crash to occur for several tries in a row. The sequence of events is to start with IB not running, double-click my nib to launch IB and open it, test the interface and interact a bit with the color well. Finally, quit out of testing the interface, then quit IB.
I've double-checked the bind:, unbind:, etc. methods and nothing looks any different from the Joystick sample. Although, one difference is that the Joystick sample works with float attributes and my baseColor attribute is an object (NSColor). I'll probably simplify my code a bit to work with a 'scalar' type of attribute and see what happens.
Any pointers would be greatly appreciated.
[1] <http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/HowDoBindingsWork.html>
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden