Re: NSArrayController and bindings
Re: NSArrayController and bindings
- Subject: Re: NSArrayController and bindings
- From: Bjoern Kriews <email@hidden>
- Date: Tue, 24 Feb 2004 22:51:55 +0100
On 24.02.2004, at 21:49, Rob Borsuk wrote:
On Feb 24, 2004, at 3:29 PM, mmalcolm crawford wrote:
I would like to be able to count the dictionary objects but it
doesn't seem that NSArrayController (though using 'Array' in the
name) has a 'count' method.
Use the array operator @count.
http://developer.apple.com/documentation/Cocoa/Conceptual/
KeyValueCoding/Concepts/ArrayOperators.html
is what you want to read.
(in case you have problems understanding it, read up on Key Value
Coding in general, see link at top of page)
When looking for docs on Controller objects and Key Value Coding /
Observing / Bindings go to developer.apple.com,
there is much more than on your disk.
I would like to be able to write the "array" out as a text file
(viola - plist) but it seems that it likes to save as a encoded
format.
Don't subclass Cocoa objects if you don't have to - it easier to use
another object:
Subclass NSObject 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 - see NSArray
docs for the rest -
when I was new to Cocoa I had to learn that the good stuff is often
hidden in obvious places :-)
Hope that helps, Bjoern
_______________________________________________
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.