• 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
Table selectionIndexes not tracking bound model updates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Table selectionIndexes not tracking bound model updates


  • Subject: Table selectionIndexes not tracking bound model updates
  • From: Bruce Lacey <email@hidden>
  • Date: Thu, 3 Feb 2005 07:53:55 -0800

I have encountered a problem where a table view that is bound to an NSArrayController properly adds and removes objects in the table when I programatically add and remove the objects in the model however the table's selection does not track the inserted objects. I have reviewed the bindings documentation and the examples on mmalc's site but I can't figure out what I am doing wrong; it seems that it should work...

Does anyone see what I am doing wrong in the following?

1) A table view with 3 columns is bound to scheduledJobsController's (an NSArrayController subclass) arrangedObjects.<key> for each column. Binding the columns will automatically bind the table's content and selectionIndexes (according to the docs)

2) scheduledJobsController's contentArray is bound to a property of an SDCrontab instance that returns an array of jobs.

[scheduledJobsController bind: @"contentArray" toObject: [SDCrontab sharedUserCrontab] withKeyPath: @"jobs" options: nil];

Note: I over-rode the arrangeObjects: method in scheduledJobsController to return a filtered list of jobs that are "owned" by this application

3) The model class "SDCrontab" is a singleton that manages an array of "SDCronjob" job entries. SDCrontab has KVC-compliant indexed-accessor methods created by Accessorizer for adding and removing SDCronjob objects.

- (unsigned int)countOfJobs
- (unsigned int)index
- (id)anObject inJobsAtIndex:(unsigned int)index
- (unsigned int)index
- (unsigned int)index withObject:(id)anObject

When I programmatically add an SDCronjob to the SDCrontab using the indexed-accessor methods, the job appears in the table but the table selection is not updated to select the inserted object. I even tried [scheduledJobsController setSelectsInsertedObjects: YES] and binding the Table's selectionIndexes to the scheduleJobsController selectionIndexes using IB but that did not help.

Debugging techniques/suggestions that will help me gain insight to diagnose the problem are also welcome...

Regards,
Bruce

 _______________________________________________
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

  • Prev by Date: Re: NSCalendarDate picker widget?
  • Next by Date: Re: NSCalendarDate picker widget?
  • Previous by thread: Re: Method not seeing array as array[solved]
  • Next by thread: NSToolbar(item) quirk
  • Index(es):
    • Date
    • Thread