Using Array Controllers to restrict the view in one popup depending on the selection in another. Not
Posted
by mjohnh
on Stack Overflow
See other posts from Stack Overflow
or by mjohnh
Published on 2009-12-31T15:11:12Z
Indexed on
2010/04/18
2:03 UTC
Read the original article
Hit count: 299
I am working on an app that is not core data based - the data feed is a series of web services.
Two arrays are created from the data feed. The first holds season data, each array object being an NSDictionary. Two of the NSDictionary entries hold the data to be displayed in the popup ('seasonName') and an id ('seasonID') that acts as a pointer (in an external table) by matches defined for that season.
The second array is also a collection of NSDictionaries. Two of the entries hold the data to be displayed in the popup ('matchDescription') and the id ('matchSeasonId') that points to the seasonId defined in the NSDictionaries in first array.
I have two NSPopUps. I want the first to display the season names and the second to display the matches defined for that season, depending on the selection in the first.
I'm new at bindings, so excuse me if I've missed something obvious. I've tried using ArrayControllers as follows:
SeasonsArrayController: content bound to appDelegate seasonsPopUpArrayData.
seasonsPopup: content bound to SeasonsArrayController.arrangedObjects; content value bound to SeasonsArrayController.arrangedObjects.seasonName
I see the season names fine. I can obviously follow a similar route to see the matches, but I then see them all, instead of restricting the list to the matches for the season highlighted.
All the tutorials I can find seem to revolve around core data and utilise the relationships defined therein. I don't have that luxury here. Any help very gratefully received.
© Stack Overflow or respective owner