• 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
introduction and question of nesting NSCollectionView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

introduction and question of nesting NSCollectionView


  • Subject: introduction and question of nesting NSCollectionView
  • From: Greg Beaver <email@hidden>
  • Date: Sun, 21 Dec 2008 00:43:17 -0600

Hi,

I'm new to cocoa, having acquired a macbook pro in September.  I have a
question regarding an application I am working on.  It is a port of a
program originally written as an ajax app with javascript front and
php/mysql backend that is used for running the internals of a summer
music program that I teach at.

Basically, I am trying to represent a listing of chamber music groups
(string quartet, piano trio, etc.) as a vertical listing of groups
containing a horizontal list of students as in:

Group 1 [String Quartet] violin violin viola cello
Group 2 [Piano Trio] violin cello piano

and so on, where the user can click the "violin" to get a list of
students, choose a student and they will be assigned to the group, or
click on a student in a list of violinists on the right.

The data model (core data) defines entity "Group" with a one-to-many
relationship to "studentsInGroup."  The relationship is named "students"

To implement this, I have used a collection view so that I can have a
complete form for each chamber group, and then I was planning on nesting
another NSCollectionView inside, with Content bound to the
NSCollectionViewItem's representedObject.students.  I set up an
NSArrayController and tried binding it to the
"representedObject.students" as Content Set, and got a count of 0, even
though there were 4 students set up.  I get the full list when I remove
Content Set, so the managed object context binding is working.

Thinking this might be a case where I need to set up each array
controller programmatically, I used this code:

    members = [[NSArrayController alloc] init];
    [members setManagedObjectContext:group.managedObjectContext];
    [members setContent:group.students];
    [members setEntityName:@"studentsInGroup"];

to initialize the array controller, with again no luck.

Can anyone confirm whether this idea could even work and what my mistake is?

To be frank, I am a bit unimpressed with how difficult it is to even
tell what is going on under the hood.  Are there any decent debugging
tools for Cocoa beyond the half-blind debugger in Xcode?

Thanks,
Greg
_______________________________________________

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

  • Prev by Date: Re: NSMutableArray sorting
  • Next by Date: os x gui scripting
  • Previous by thread: NSFileManager copy -> AFP croaks on extended attributes
  • Next by thread: os x gui scripting
  • Index(es):
    • Date
    • Thread