Inherits From:
EOAssociation : EODelayedObserver : NSObject
Conforms To:
NSCoding (EOAssociation)
EOObserving (EODelayedObserver)
NSObject (NSObject)
Declared in: EOInterface/EOPopUpAssociation.h
Examples
Selecting a string from a static list: Given an EODisplayGroup of Movies, the goal is to provide a pop-up list for setting the rating. Assume the rating is a string property of the Movie object rather than a relationship to a Rating object. In this case you type the list of ratings into the pop-up list in Interface Builder, and then bind the selectedTitle aspect to the "rating" property of the Movie EODisplayGroup. If an object's string attribute value isn't in the pop-up list, it's temporarily added while the object is selected.
Selecting a string from a dynamic list: As above, but we want to fill the popup from the "ratingString" property of an EODisplayGroup containing an array of Rating objects fetched from an external source. In this case you bind the titles aspect to the "ratingString" property of the Ratings EODisplayGroup, and bind the selectedTitle aspect to the "rating" property of the Movie EODisplayGroup.
Selecting an integer tag from a static list: Given an EODisplayGroup of customers, whose credit card type is indicated by a tag, the goal is to provide the credit card name on the pop-up list (Visa, MasterCard, and so on). In this case you set the credit card names and tags for the pop-up list in Interface Builder, and then bind the selectedTag aspect to the "cardType" property of the Customer EODisplayGroup. You can also allow for a general "other" value by defining a special tag and setting it in the EOPopUpAssociation using setTagValueForOther: . Credit card tags from the database not matching any in the pop-up list are then displayed as the "other" value. (It would also make sense to disable the pop-up list in this case, to avoid writing the meaningless tag back to the database.)
Selecting an object to assign to a to-one relationship: Given a list of employees, the goal is to assign the department each employee belongs to. In terms of the object model, we want to assign a Department object to the "department" property of an Employee object. In this case you bind the titles aspect to the "name" property of a Department EODisplayGroup, and bind the selectedObject aspect to the "department" relationship property of the Employee EODisplayGroup. This fills the pop-up list with the names of departments, and causes the name of the selected Employee's Department to be selected in the pop-up list.
Records tag as the "unknown" tag. When a property value doesn't match any other tag in the pop-up list, the EOPopUpAssociation automatically selects the item for this tag. If there's no item for this tag, the pop-up list's selection isn't changed. This tag value is by default -1.
tagValueForOther
- (int)tagValueForOther
Returns the "unknown" tag. When a property value doesn't match any other tag in the pop-up list, the EOPopUpAssociation automatically selects the item for this tag. If there's no item for this tag, the pop-up list's selection isn't changed. This tag value is by default -1.
Copyright © 1997, Apple Computer, Inc. All rights reserved.