• 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 delete objects once removed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController delete objects once removed


  • Subject: Re: NSArrayController delete objects once removed
  • From: Chris Hanson <email@hidden>
  • Date: Sat, 15 Dec 2007 17:28:26 -0800

On Dec 15, 2007, at 4:31 AM, Matthew Delves wrote:

The logic of my application is that there is an NSArrayController which contains an array of object that are displayed in an NSTableView.

Better would be to have the array of model-layer objects actually owned by some other object in your system, and only *controlled* by an NSArrayController.


Then when your view-layer code asks the NSArrayController to remove an object, it will pass that removal along to its content array, which is the model-layer removal.

In general, I almost never have an NSController subclass which actually "owns" or "contains" the object or objects it controls. Doing so is fine for putting together demos in Interface Builder but it isn't really the kind of model-view-controller architecture needed for real applications.

  -- Chris

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSArrayController delete objects once removed
      • From: Matthew Delves <email@hidden>
References: 
 >NSArrayController delete objects once removed (From: Matthew Delves <email@hidden>)

  • Prev by Date: Re: Efficient hierarchical menu from path?
  • Next by Date: Re: Doesn't -willChangeValueForKey: copy the value before I change it?
  • Previous by thread: Re: NSArrayController delete objects once removed
  • Next by thread: Re: NSArrayController delete objects once removed
  • Index(es):
    • Date
    • Thread