• 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: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler


  • Subject: Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 02 May 2011 13:15:12 -0700

On May 2, 2011, at 12:47, email@hidden wrote:

> anotherItemController
> Content Array
> Bind to: MyAppsClass (added an NSObject from palette and set its class to MyAppsClass)
> Controller Key: myMutableArray

If this is what you were calling a "proxy" earlier, it isn't. It's a separate instance of MyAppsClass that's (re-)created when the nib is loaded.

I'm assuming that MyAppsClass represents an app delegate singleton. The normal way to create it is to place an instance in the MainMenu nib, and connect the Application proxy's delegate outlet to it.

If the nib file you're referring to above is actually the MainMenu nib, then that's fine. If not, then you've created a second instance -- you shouldn't have added a NSObject from the palette, but should have bound to the Application proxy instead, using the "delegate" key to get to the existing singleton object.

> If I set a breakpoint after the item has been removed and then in gdb: po (NSArray*)[mycontroller arrangedObjects] . The removed item is not in the array. If during archiving, I do the same, the removed item is back.

You kind of sidestepped the question here. There are, if I understand correctly, 2 different array controllers (one for each NIB), both of which are supposed to use the same underlying data model array for their content. You're not saving the array controllers (at least I hope not), but you're saving the underlying data model. Therefore looking at the array controller (or even their arrangedObjects) doesn't tell you anything about what's being saved.

What you should be trying to resolve, using the debugger, is the question of whether there are 2 underlying data model arrays when there should be only one. To do that, you need to be looking at the object address of the mutable array(s).


_______________________________________________

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: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
      • From: Lorenzo Thurman <email@hidden>
References: 
 >Re: Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler (From: email@hidden)

  • Prev by Date: Re: Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
  • Next by Date: Re: Service with optional input
  • Previous by thread: Re: Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
  • Next by thread: Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
  • Index(es):
    • Date
    • Thread