• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArrayController and bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController and bindings


  • Subject: Re: NSArrayController and bindings
  • From: Bjoern Kriews <email@hidden>
  • Date: Wed, 25 Feb 2004 00:32:43 +0100

On 24.02.2004, at 23:47, mmalcolm crawford wrote:

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"...

Yes. I just wanted to keep the poster from unneccesarily subclassing NSArrayController :-)

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.

I agree - my intention was to answer his question in a very direct way.
And I think there are cases where it is convenient to just let the Controller
manage the array - i.e. simple preferences.

(more on that in a fresh thread "Array Bindings and NSUserDefaultsController")

Regards, 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.


  • Follow-Ups:
    • [Solved]- Re: NSArrayController and bindings
      • From: Rob Borsuk <email@hidden>
References: 
 >NSArrayController and bindings (From: Rob Borsuk <email@hidden>)
 >Re: NSArrayController and bindings (From: mmalcolm crawford <email@hidden>)
 >Re: NSArrayController and bindings (From: Rob Borsuk <email@hidden>)
 >Re: NSArrayController and bindings (From: Bjoern Kriews <email@hidden>)
 >Re: NSArrayController and bindings (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Tooltip for cell or column of NSTableView?
  • Next by Date: Re: key value observing stops
  • Previous by thread: Re: NSArrayController and bindings
  • Next by thread: [Solved]- Re: NSArrayController and bindings
  • Index(es):
    • Date
    • Thread