• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTableView selection Delegate Methods being called twice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView selection Delegate Methods being called twice?


  • Subject: NSTableView selection Delegate Methods being called twice?
  • From: Robert Kukuchka <email@hidden>
  • Date: Wed, 10 Sep 2008 15:18:52 -0700

Hello,
I'm trying to handle some selection switching of an NSTableView, but I'm getting double the calls I "expect". Why is this, or have I done something wrong?
Cheers,
Rob


BT #1
#1 0x92a2400f in -[NSTableView _sendDelegateSelectionIndexesForProposedSelection:] ()
#2 0x927fe124 in -[NSTableView _userSelectRowIndexes:withNewSelectedRow:] ()
#3 0x927fe08c in -[NSTableView _userSelectSingleRow:] ()
#4 0x927fbc9c in -[NSTableView mouseDown:] ()
#5 0x927b388b in -[NSWindow sendEvent:] ()
#6 0x92780431 in -[NSApplication sendEvent:] ()
#7 0x926dde27 in -[NSApplication run] ()
#8 0x926ab030 in NSApplicationMain ()
#9 0x00002ce3 in main (argc=1, argv=0xbffff724) at /Users/ robertkukuchka/CodeDev/SoftBank MWL/main.m:25


I return the same index in this call..

BT #2
#1 0x92a2400f in -[NSTableView _sendDelegateSelectionIndexesForProposedSelection:] ()
#2 0x927fe408 in -[NSTableView _userSelectableRowIndexesForProposedSelection:] ()
#3 0x927fefd2 in -[NSTableView _userCanSelectSingleRow:] ()
#4 0x927fbeba in -[NSTableView mouseDown:] ()
#5 0x927b388b in -[NSWindow sendEvent:] ()
#6 0x92780431 in -[NSApplication sendEvent:] ()
#7 0x926dde27 in -[NSApplication run] ()
#8 0x926ab030 in NSApplicationMain ()
#9 0x00002ce3 in main (argc=1, argv=0xbffff724) at /Users/ robertkukuchka/CodeDev/SoftBank MWL/main.m:25


I'm not sure why I get the delegate call twice. I can see that (obviously) _userSelectableRowIndexesForProposedSelection and _userSelectRowIndexes:withNewSelectedRow must both call _sendDelegateSelectionIndexesForProposedSelection, but why is this happening twice. Does returning the old value cause the second call?

For context I'm trying to mimic the behaviour within Apple Mail's Preferences->Account dialog.
I want to prevent a user from switching items in an NSTableView (Accounts) unless they respond to a modal panel (Save, Don't Save, Cancel). I'm trying to use NSBeginAlertPanel + store the next and current selections (since NSBeingAlertPanel doesn't block) within a selection delegate method.


Am I doing this in a convoluted way?

Cheers,
Rob





_______________________________________________

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


  • Follow-Ups:
    • Re: NSTableView selection Delegate Methods being called twice?
      • From: Corbin Dunn <email@hidden>
  • Prev by Date: Re: C/Obj-C API Confusion
  • Next by Date: Re: Menu for multiple document types
  • Previous by thread: Re: mailbundle info
  • Next by thread: Re: NSTableView selection Delegate Methods being called twice?
  • Index(es):
    • Date
    • Thread