NSTableColumn, NSButtonCell and target bindings
NSTableColumn, NSButtonCell and target bindings
- Subject: NSTableColumn, NSButtonCell and target bindings
- From: Clark Cox <email@hidden>
- Date: Thu, 10 Feb 2005 10:12:51 -0500
I'm having trouble with something that seems like it should be rather
simple. I have an NSTableView bound to an NSArrayController,
controlling an array of ProfileRowData (a class of my own). All works
as expceted, save for the fact that I have a column of NSButtonCell's,
and can't seem to work out the correct incantations to bind their
targets. The buttons are there to allow the user to choose a filename
associated with the particular row .
I have implemented, on ProfileRowData, a method:
-(void)selectFilename:(id)sender; That I want called when the button
is clicked.
However, I can't seem to get it called. In IB, I have that particular
column's target binding bound to the NSArrayController's
arrangedObjects, with a NSSelectorName of "selectFilename:".
When I run the application, the table is properly populated. However,
when I click on the button, my method is never called, and the
application dies deep inside the AppKit framework. I'm obviously
missing something:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x0000000c
Thread 0 Crashed:
0 com.apple.Foundation 0x90a10660 +[NSInvocation
newInvocationWithMethodSignature:] + 0x18
1 com.apple.Foundation 0x90a4b034 +[NSInvocation
invocationWithMethodSignature:] + 0x20
2 com.apple.AppKit 0x931ab85c
-[NSObject(_NSBinderKeyValueCodingAdditions)
_invokeSelector:withArguments:onKeyPath:] + 0x120
3 com.apple.AppKit 0x931ab82c
-[NSObject(_NSBinderKeyValueCodingAdditions)
_invokeSelector:withArguments:onKeyPath:] + 0xf0
4 com.apple.AppKit 0x931b7a70 -[NSBinder
_invokeSelector:withArguments:onKeyPath:ofObject:atIndex:raisesForNotApplicableKeys:]
+ 0x98
5 com.apple.AppKit 0x931ba9cc -[NSBinder
invokeSelector:withArguments:forBinding:atIndex:error:] + 0x12c
6 com.apple.AppKit 0x931cc860 -[_NSActionBinderPlugin
invokeSelector:withArguments:forBinding:object:] + 0x8c
7 com.apple.AppKit 0x931de360 -[NSActionBinder
_invokeSelector:withArguments:forBinding:] + 0x64
8 com.apple.AppKit 0x931deb48 -[NSActionBinder performAction:] + 0x3a4
9 com.apple.AppKit 0x931abe38 -[_NSBindingAdaptor
_objectDidTriggerAction:bindingAdaptor:] + 0x94
10 com.apple.AppKit 0x931ac8fc -[_NSBindingAdaptor
objectDidTriggerAction:] + 0xe0
11 com.apple.AppKit 0x92e7ef1c -[NSControl sendAction:to:] + 0x3c
12 com.apple.AppKit 0x92eb91f4 -[NSCell _sendActionFrom:] + 0x9c
13 com.apple.AppKit 0x92e58cb8 -[NSCell
trackMouse:inRect:ofView:untilMouseUp:] + 0x3fc
14 com.apple.AppKit 0x92ec9e04 -[NSButtonCell
trackMouse:inRect:ofView:untilMouseUp:] + 0x234
15 com.apple.AppKit 0x92e7e708 -[NSTableView mouseDown:] + 0x918
16 com.apple.AppKit 0x92e03178 -[NSWindow sendEvent:] + 0x10e4
17 com.apple.AppKit 0x92df583c -[NSApplication sendEvent:] + 0xebc
18 com.apple.AppKit 0x92dfdc54 -[NSApplication run] + 0x240
19 com.apple.AppKit 0x92eba2b8 NSApplicationMain + 0x1d0
20 main.ob 0x000b5f74 main + 0x38 (main.m:13)
21 com.apple.myCocoaApp 0x00002694 start + 0x1c8
22 dyld 0x8fe1a558 _dyld_start + 0x64
PPC Thread State:
srr0: 0x90a10660 srr1: 0x0200f030 vrsave: 0x00000000
cr: 0x24004248 xer: 0x00000000 lr: 0x90a4b034 ctr: 0x90a10648
r0: 0x90a4b034 r1: 0xbfffde50 r2: 0xa00011ac r3: 0xa0a04ed8
r4: 0x90884370 r5: 0x00000000 r6: 0x00495c50 r7: 0xa2ddf980
r8: 0xa0190dcc r9: 0x0040c7d8 r10: 0x00000004 r11: 0x00000001
r12: 0x90a10648 r13: 0x00000000 r14: 0x00000100 r15: 0x00000000
r16: 0xa2de88bc r17: 0xa2de88bc r18: 0x004e5010 r19: 0xa01901a4
r20: 0x004e4ea0 r21: 0x00495060 r22: 0x004dc7d0 r23: 0x00000000
r24: 0x00495c50 r25: 0x00495c50 r26: 0xa2dfb73c r27: 0x004e5010
r28: 0x004c89f0 r29: 0x00000000 r30: 0xa2ddf980 r31: 0x90a10648
--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
_______________________________________________
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