Controller layer and application design
Controller layer and application design
- Subject: Controller layer and application design
- From: Bill So <email@hidden>
- Date: Wed, 17 Dec 2003 13:35:41 +0800
Dear All,
I have a questions after reading the ADC TV and Controller Layer
documentation.
My Question is:
- In all Apple's example about the new controller layer, when the
NSArrayController object is used, there is always an "Add" button (or
equivalence) in those sample app.
- When user click "Add", a new data source object is created.
- User then select the new data source object and there are some text
views showing the data of the selected data entry.
- If user wants to edit the data, edit the data shown in text views.
- How to do something reverse?
i.e.: Create a new object using the values entered in text views. The
new object is then added into the NSArrayController.
I have 2 ideas to solve this problem:
Method 1: subclass NSArrayController. Add outlets that connect to the
text fields. Add new object when subclassed NSArrayController detects
changes in the text fields.
Method 2: use a NSObjectController in addition to the
NSArrayController. The NSObjectController is used to bind to the text
fields. The NSObjectController passes messages to NSArrayController to
add new data source object.
Method 1 doesn't use key-value bindings for text fields. But method 2
does.
What's your opinion?
Thank your very much for your help.
Yours,
Bill
Headnix
email@hidden / email@hidden
http://www.headnix.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.