Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / February 2008



Tip: Looking for answers? Try searching our database.

Bindings help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lorenzo Thurman - 14 Feb 2008 15:10 GMT
I've used cocoa bindings for preferences, but this is my first serious
use of Bindings, so here's my problem:
I have a window with an attached drawer. The drawer contains an
NSTableView which I want to display data stored in some NSDictionarys
contained in an NSArray. The dictionaries are obtained from an XML
document parsed with NSXMLParser. Each dictionary contained in the
array, constitutes a row in the table. I've read through the docs at
Apple's site and looked through some examples here:
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html

But I'm still confused. Should I use an NSObjectController and an
NSArrayController, just an NSArrayController or do I need either at all?
When I tried working with both an NSObjectController and an
NSArrayController, I got various errors like these:

Internal consistecy error: this value is not key value coding compliant
for the key cities
(cities was the name of my NSArray)

When connecting things in IB3, I connected the NSObjectController to my
controller class which contains my NSArray as an outlet. Then I bound my
NSArrayController to my NSObjectCOntroller's selectedObjects.

Can anyone provide me with any tips on how to do this?
Thanks
Lorenzo Thurman - 17 Feb 2008 02:42 GMT
> I've used cocoa bindings for preferences, but this is my first serious
> use of Bindings, so here's my problem:
[quoted text clipped - 21 lines]
> Can anyone provide me with any tips on how to do this?
> Thanks
I figured it out. No, I don't need an objectcontroller, just the
arraycontroller. I bound the arraycontroller to my controller object
with a keypath using the array that actually holds the data.
Simple.
ibloom - 24 Feb 2008 03:52 GMT
On Feb 16, 9:42 pm, Lorenzo Thurman <lore...@diespammerhethurmans.com>
wrote:
> > I've used cocoa bindings for preferences, but this is my first serious
> > use of Bindings, so here's my problem:
[quoted text clipped - 26 lines]
> with a keypath using the array that actually holds the data.
> Simple.

I'm doing something similar and I'm trying to understand:
I've bound an NSArrayController to NSApplication which delegates
arrayContent to my AppDelegate class, it calls a method to retrieve a
list of dictionaries.
This all works just fine.
But I can't figure out, when I load a new XML file I want the
NSArrayController to read a new dictionary by calling my method again.
How do I tell it to do this??

Ian Bloom
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.