• 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 manage array in MyObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController manage array in MyObject


  • Subject: Re: NSArrayController manage array in MyObject
  • From: Larry Fransson <email@hidden>
  • Date: Fri, 23 Apr 2004 14:22:19 -0700

On Apr 23, 2004, at 12:49, matt neuburg wrote:

Okay. Now I want to do the parallel thing with an array (of mutable
dictionaries). So I've got an NSMutableArray in MyObject call coolArray.
I've got the "content" outlet of an NSArrayController pointing at MyObject.
How can I bind a table column to coolArray through this NSArrayController?
In other words, how do I specify that the thing the NSArrayController should
manage within MyObject is coolArray? (You see why this would be parallel to
what I'm doing now?) Thx - m.

PS I see how to do this by binding, but you can't bind an NSArrayController
to anything except the file's owner and the shared defaults. That's why I
want to do it with with the "content" outlet.

I don't really understand the content outlet of an array controller yet. I just haven't quite figured out what it's good for. And it's true, using IB, you can't bind an array controller's contentArray binding to anything other than what's listed there. You can, however, bind the contentArray of the array controller to your model's array programatically:

[coolArrayController bind:@"contentArray" toObject:coolModelObject withKeyPath:@"coolArray"
options:coolOptionsDictionary];

(That's an instance method of NSObject.)

From there, it's just the standard deal to bind the value of a particular table column to the array controller.

Larry Fransson
Seattle, WA
_______________________________________________
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.


References: 
 >NSArrayController manage array in MyObject (From: matt neuburg <email@hidden>)

  • Prev by Date: Prototype for NSMatrix steeling text?
  • Next by Date: Re: NSArrayController manage array in MyObject
  • Previous by thread: NSArrayController manage array in MyObject
  • Next by thread: Re: NSArrayController manage array in MyObject
  • Index(es):
    • Date
    • Thread