Re: NSArrayController and bindings
Re: NSArrayController and bindings
- Subject: Re: NSArrayController and bindings
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 24 Feb 2004 14:47:12 -0800
On Feb 24, 2004, at 1:51 PM, Bjoern Kriews wrote:
Don't subclass Cocoa objects if you don't have to - it easier to use
another object:
Subclass NSObject
Umm, NSObject is a "Cocoa object"...
into SomeController, add an outlet "arrayController" and an action
"save:", instantiate it in your nib
and connect the outlet to your ArrayController, create the source
files for SomeController and
add
[[arrayController content] writeToFile:@"/tmp/some.plist"
atomically:YES];
to the save: method.
(content returns the array the controller is managing
It is possibly more likely that SomeController has an array instance
variable to which the array controller's content is bound.
SomeController is likely also to manage other objects. Any 'save:'
method would probably therefore either simply archive SomeController's
array variable directly (as opposed to asking the arrayController for
its content), or create an archive of all the relevant data and model
objects.
mmalc
_______________________________________________
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.