• 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: Bindings & popup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings & popup


  • Subject: Re: Bindings & popup
  • From: Todd Freese <email@hidden>
  • Date: Wed, 28 Jul 2004 18:41:55 -0500

Now that all is working, I was wondering of there is a better way...

In my TableView, I have three popup columns. Each popup has it9s own
NSArrayController. Is there a way to combine all three NSArrayControllers
into one?

I was thinking in the lines of a Dictionary or an array pointing to each of
the popup content arrays... But I am not sure how to set this up.

Thanks,

Todd




From: mmalcolm crawford <email@hidden>
Date: Mon, 26 Jul 2004 21:33:46 -0500
To: Todd Freese <email@hidden>
Subject: Re: Bindings & popup



On Jul 26, 2004, at 6:36 PM, Todd Freese wrote:

> I just want to basically tell the popup to use this single array of
> options. A good example would be how a combobox works in a tableview.
> Enter a few options in IB and be done with it.
>
That's illustrated in the example.

Just look at the bindings for the popup in the table view: the only
relevant method is in MyDocument.m:

- (NSArray *)categories
{
return [Category allCategories];
}


Following that you get to Category.m:


+ (NSArray *)allCategories
{
static NSArray *categories;
if (!categories)
{
categories = [[NSArray alloc] initWithObjects:
[Category categoryWithTitle:@"Vital"
andPriority:11],
[Category categoryWithTitle:@"Very Important"
andPriority:4],
[Category categoryWithTitle:@"Important" andPriority:3],
[Category categoryWithTitle:@"Not Important" andPriority:2],
[Category categoryWithTitle:@"Whenever" andPriority:0],
nil];
}
return categories;
}


That's all the relevant material...

mmalc
_______________________________________________
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:
    • Re: Bindings & popup
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Confused with Chapter 7 in Hillegass' book (2nd ed.)
  • Next by Date: Re: Bindings & popup
  • Previous by thread: Re: Bindings & popup
  • Next by thread: Re: Bindings & popup
  • Index(es):
    • Date
    • Thread