• 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
Binding NSArrayController to program
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding NSArrayController to program


  • Subject: Binding NSArrayController to program
  • From: Hans van der Meer <email@hidden>
  • Date: Mon, 11 Feb 2008 12:21:03 +0100

There is something I must misunderstand. The goal is to have an object in the program reacting on some action from the gui by calculating new rows for a tableview.

The calculating object has a property:
@property(copy) NSMutableArray *solutions;
which is given in IB to the NSArrayController as Model Key Path.
However, adding objects to this solutions variable does nothing in the tableview coupled to the arraycontroller.


Things change when I give the added objects not to solutions but add them with:
[solutionsController addObject:...]
The solutionsController being an IBOutlet coupled to the arraycontroller. Now the objects added are becoming visible in the table and can be found with [solutionsController arrangedObjects]. But the solutions variable itself stays unaffected by the additions in spite of the apparent binding to solutions.


I must conclude that the arraycontroller manages its own version of the array, but what then is the solutions variable doing? I cannot remove it or the program stops functioning. And what if I would like to do the change on the solutions variable and propagate it to the table instead of directly reaching into the arraycontroller?

I must admit being quite confused here.

Hans van der Meer




_______________________________________________

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: Binding NSArrayController to program
      • From: Hank Heijink <email@hidden>
  • Prev by Date: easily search Address Book for phone numbers in various formats?
  • Next by Date: Re: Binding NSArrayController to program
  • Previous by thread: Re: easily search Address Book for phone numbers in various formats?
  • Next by thread: Re: Binding NSArrayController to program
  • Index(es):
    • Date
    • Thread