Core Data/Bindings Issue re: pop-ups and multiple relationships
Core Data/Bindings Issue re: pop-ups and multiple relationships
- Subject: Core Data/Bindings Issue re: pop-ups and multiple relationships
- From: "Andrew R. Kinnie" <email@hidden>
- Date: Sun, 12 Nov 2006 12:22:40 -0500
I am trying to create a document-based app small app that uses Core
Data and bindings. I'm having strange data consistency issues with
popup buttons.
My app is a helper app for a non-computer game similar to a role-
playing game. I have an entity called "Character" which has a to-one
relationship to another entity called "Nationality" (and vice versa
as a to-many).
The interface has a tabview which has an item for character, an item
for spotting and an item for firing. The Character tabViewItem is
where the user can set up the participants in the game. There is a
table for nationalities, where the user can create and delete
nationalities. There is another table for characters in the selected
nationality. I have an NSArrayController called Nationalities which
is set to that entity. I have another called Characters which is set
to that entity, but has bindings to the Nationalities array
controller's selection.characters key. This seems to work fine.
However, when I try to create interfaces for the other tabViewItems,
I seem to be having trouble, especially when I use popup buttons. I
created a popup for the spotter's nationality bound as follows:
content -> Nationalities - arranged objects
content value -> Nationalities - arranged objects - nationality name
(a string)
selected object -> Characters - selection - nationality
I also have another popup for characters, and I wanted that to be set
to the characters within the selected nationality from the first
popup. This has no effect currently.
When I run this, I can create nationalities, then characters under
those nationalities. However, when I go to another tabViewItem, if
the tabViewItem has two tables (Nationality and Character) the
characters appear properly. If I go to the tabView with the popup,
the Nationalities appear in the popup, but no characters appear. If
I select a different nationality, the characters both seem to change
to have that nationality, and this is reflected in the tableViews.
When I change it back, the characters go back to having the same
separate nationalities they originally were set with.
Do popUp buttons work with bindings? With Core Data? How should
this be done?
Another issue is: I was under the impression that you only needed one
array controller for each entity, but there seems to be an issue with
this, because, especially in the Spot tabViewItem, I need the
nationality popup for the spotter to filter characters so I only see
the characters of that particular nationality. Then, I also want to
select another character being spotted, so I want either a table or
another couple popups to select the nationality of the character
being spotted, and the characters within that nationality. So I
guess my question is, should I create a different ArrayController for
each differently filtering? In other words, an array controller for
spotters and another for spot targets?
Thanks in advance.
Andrew
_______________________________________________
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