Re: NSTableView Column Header Restrictions?
Re: NSTableView Column Header Restrictions?
- Subject: Re: NSTableView Column Header Restrictions?
- From: Daniel Wambold <email@hidden>
- Date: Tue, 19 Jan 2010 20:29:22 -0500
> On Jan 19, 2010, at 3:30 PM, Daniel Wambold wrote:
>
>> I have an NSTableView that I populate with columns programmatically. I use the following to establish the header titles:
>>
>> NSTableHeaderCell *myGenericHeaderCell = [[[NSTableHeaderCell alloc] initTextCell:myTableColumnTitle] autorelease];
>> [myGenericHeaderCell setAlignment:NSCenterTextAlignment];
>> [myGenericHeaderCell setEditable:NO];
>> [myGenericHeaderCell setSelectable:NO];
>> [aTableColumn setHeaderCell:myGenericHeaderCell];
>>
>> From there, I add the column to the tableView. My problem is that, if I use a header name that contains a period (.), the tableView tries to validate my data. Is this expected behavior? I have no validation routines anywhere in the program or in IB, and I can only seem to work around this by changing the column names. I can't find this behavior referenced in the NSTableView or NSTableHeaderCell docs.
>
> There are no such restrictions. Can you post a backtrace of when it is being validated when you don't expect it to be? There must be something else going on.
>
> ...corbin
The modal sheet claiming "An error occurred," with <Discard changes> and <OK> buttons appears with this trace:
#0 0x7fff88491e3a in mach_msg_trap
#1 0x7fff884924ad in mach_msg
#2 0x7fff87bb87a2 in __CFRunLoopRun
#3 0x7fff87bb7c2f in CFRunLoopRunSpecific
#4 0x7fff87fa6a4e in RunCurrentEventLoopInMode
#5 0x7fff87fa6853 in ReceiveNextEventCommon
#6 0x7fff87fa670c in BlockUntilNextEventMatchingListInMode
#7 0x7fff84f061f2 in _DPSNextEvent
#8 0x7fff84f05b41 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#9 0x7fff84ecb747 in -[NSApplication run]
#10 0x7fff84ec4468 in NSApplicationMain
#11 0x1000030f5 in main at main.m:13
If I allow my endEditing timer to fire, I end up with a separate alert window containing identical text and buttons as the above modal sheet, and this trace:
#0 0x7fff88491e3a in mach_msg_trap
#1 0x7fff884924ad in mach_msg
#2 0x7fff87bb87a2 in __CFRunLoopRun
#3 0x7fff87bb7c2f in CFRunLoopRunSpecific
#4 0x7fff87fa6a4e in RunCurrentEventLoopInMode
#5 0x7fff87fa6853 in ReceiveNextEventCommon
#6 0x7fff87fa670c in BlockUntilNextEventMatchingListInMode
#7 0x7fff84f061f2 in _DPSNextEvent
#8 0x7fff84f05b41 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#9 0x7fff85140943 in -[NSApplication _realDoModalLoop:peek:]
#10 0x7fff8513e4cd in -[NSApplication runModalForWindow:]
#11 0x7fff8513b981 in -[NSAlert runModal]
#12 0x7fff8515d7ef in -[NSApplication(NSErrorPresentation) presentError:]
#13 0x7fff854e2d82 in -[NSWindowController presentError:]
#14 0x7fff854c0e15 in -[NSValueBinder _presentDiscardEditingSheetWithError:discardEditingCallback:otherCallback:callbackContextInfo:relatedToBinding:]
#15 0x7fff854bfca8 in -[NSValueBinder _handleApplyValueError:forBinding:canRecoverFromErrors:handleErrors:typeOfAlert:discardEditingCallback:otherCallback:callbackContextInfo:didRunAlert:]
#16 0x7fff854c0809 in -[NSValueBinder _applyObjectValue:forBinding:canRecoverFromErrors:handleErrors:typeOfAlert:discardEditingCallback:otherCallback:callbackContextInfo:didRunAlert:]
#17 0x7fff854c05b4 in -[NSValueBinder applyDisplayedValueHandleErrors:typeOfAlert:canRecoverFromErrors:discardEditingCallback:otherCallback:callbackContextInfo:didRunAlert:]
#18 0x7fff854bfb9f in -[NSValueBinder _applyDisplayedValueIfHasUncommittedChangesWithHandleErrors:typeOfAlert:discardEditingCallback:otherCallback:callbackContextInfo:didRunAlert:]
#19 0x7fff854bf7f1 in -[NSValueBinder validateAndCommitValueInEditor:editingIsEnding:errorUserInterfaceHandled:]
#20 0x7fff854f083b in -[_NSBindingAdaptor _validateAndCommitValueInEditor:editingIsEnding:errorUserInterfaceHandled:bindingAdaptor:]
#21 0x7fff854f0746 in -[_NSBindingAdaptor validateAndCommitValueInEditor:editingIsEnding:errorUserInterfaceHandled:]
#22 0x7fff8540ab7a in -[NSTableView textShouldEndEditing:]
#23 0x7fff8508a30c in -[NSTextView(NSSharing) resignFirstResponder]
#24 0x7fff84eff07b in -[NSWindow makeFirstResponder:]
#25 0x7fff850673cd in -[NSWindow endEditingFor:]
#26 0x7fff84f2847f in -[NSView removeFromSuperview]
#27 0x7fff85086ca5 in -[_NSKeyboardFocusClipView removeFromSuperview]
#28 0x7fff8508b04f in -[NSCell endEditing:]
#29 0x1000147ea in -[MyContinuousTableViewDelegate myEndEditing] at MyContinuousTableViewDelegate.m:114
#30 0x100014668 in -[MyContinuousTableViewDelegate myTimerAction:] at MyContinuousTableViewDelegate.m:100
#31 0x7fff86688a39 in __NSFireTimer
#32 0x7fff87bb9a58 in __CFRunLoopRun
#33 0x7fff87bb7c2f in CFRunLoopRunSpecific
#34 0x7fff87fa6a4e in RunCurrentEventLoopInMode
#35 0x7fff87fa6853 in ReceiveNextEventCommon
#36 0x7fff87fa670c in BlockUntilNextEventMatchingListInMode
#37 0x7fff84f061f2 in _DPSNextEvent
#38 0x7fff84f05b41 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#39 0x7fff84ecb747 in -[NSApplication run]
#40 0x7fff84ec4468 in NSApplicationMain
#41 0x1000030f5 in main at main.m:13
I guess I just have demons in my Mac. At least I can exorcise them by removing the period in the column title.
-W_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden