Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSArrayController Bindings

NSArrayController Bindings
Thread Tools
3R1C
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Nov 19, 2005, 12:42 PM
 
Hey all,

I'm trying to wrap my mind around NSArrayController and using bindings with them. Im working on a test app that basically mimics iTunes' browser. I chose this because it would be easier to communicate to you all what Im trying to do as well as a simplest test case.

The interface is like this: 3 single column tables up top, genre, artist, album. Underneath is a table with 3 columns. The 3 columns are genre, artist and album. Data for the app is managed via core data. I have plus and minus buttons to add/remove items to the lower table.

Im trying to get the 3 tables up top to act like iTunes in that, if i select a genre, only those artists that match the selected genre are listed in the next table, the artist table. Then if an artist is selected, only those albums that match the artist are listed in the album table. The end result of course would be that only those items in the core data store, that match the users selection of genre, artist and album would be visible in the lower table.

Where Im at currently is that I can add/remove items in the lower table. I have an NSArrayController that manages all the items as well as NSArrayControllers for each of the tables up top representing genre, artist and album.

Im guessing that most, if not all of this functionality can be achieved directly in IB and its bindings inspector but I don't know how to configure it. I think i working version of this interface metaphor would be great for others to use in lots of different apps. Like managing collections of DVD's recopies, stamps, coins, books whatever. You get the idea.

Anyway, I could use the mighty weight of knowledge and skillz this forum possesses to get i simple test case working. Thank you for your attention.
3R1C
     
szymczyk
Fresh-Faced Recruit
Join Date: Aug 2005
Status: Offline
Reply With Quote
Nov 20, 2005, 06:06 PM
 
You're right. Most of what you need to do to use bindings is in Interface Builder. I would recommend reading this article. It provides a solid introduction to bindings and should help you figure out what you need to do in Interface Builder to get your application working.
Mark Szymczyk
Author, Xcode Tools Sensei
http://www.meandmark.com
     
techtrucker
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Nov 21, 2005, 07:32 AM
 
Thanks for that link...I have ignored bindings up to this point but that well written article has gotten me started with bindings finally.
     
3R1C  (op)
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Nov 27, 2005, 12:57 AM
 
I had previously read that article and although it was very good, it doesn't address my specific needs. What I ended up implementing was a series of daisy chained NSArrayControllers and using NSPredicates to do filtering. It works, but is a temporary workaround. I've moved on to my latest problem which is outlined in my post titled "Editing Multiple Values in a Master/Detail Interface"
3R1C
     
techtrucker
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Nov 27, 2005, 09:16 AM
 
Yes, it doesn't address my main interest, using bindings with external data (postgresql in my case), still researching that...
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 02:17 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,