Welcome to MacForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Bindings help

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  x86_64 assembler "movb" instruction  
Author Message
Lorenzo Thurman4

External


Since: May 23, 2004
Posts: 58



(Msg. 1) Posted: Thu Feb 14, 2008 9:10 am
Post subject: Bindings help
Archived from groups: comp>sys>mac>programmer>help (more info?)

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

 >> Stay informed about: Bindings help 
Back to top
Login to vote
Lorenzo Thurman4

External


Since: May 23, 2004
Posts: 58



(Msg. 2) Posted: Sat Feb 16, 2008 8:42 pm
Post subject: Re: Bindings help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Lorenzo Thurman wrote:
> 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
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.

 >> Stay informed about: Bindings help 
Back to top
Login to vote
ibloom

External


Since: Feb 23, 2008
Posts: 1



(Msg. 3) Posted: Sat Feb 23, 2008 7:52 pm
Post subject: Re: Bindings help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Feb 16, 9:42 pm, Lorenzo Thurman
wrote:
> Lorenzo Thurman wrote:
> > 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
>
> 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.

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
 >> Stay informed about: Bindings help 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Bindings - I want to use bindings, but I don't know how to get started. All of the examples I see seem to be "Here is how to use an NSArrayController to control a table view. You also have to know about Key Value Coding." Are there any good tutorials o...

Bindings? - Where can one find information on bindings in Xcode's documentation? By bindings I mean the key-value binding capability that was added to Mac OS X 10.3 to bind a value in one object to a property in another object. The object of theses bindings is t...

Bindings and tables .. how? - I've gone through the examples at: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings While I'm impressed at how easy it is to make a table with the bindings and controllers, I can't figure out how to connect the tables made with...

Question about Bindings and Archiving - I'm referring to the tutorial "Enhanced Currency Converter" (from ADCHome > Documentation > Cocoa > Design Guidelines > Cocoa Bindings. I did it . Works great. Now I'm trying to make it save and open files (since it is based on an N...

Using bindings with NSButtonCells in NSTableView - I can't seem to figure out how to populate an NSTableColumn of NSButtonCells with data. I've bound my NSArrayController to the NSTableView and it works fine with just a plain text cell. If I use a button cell, the strings don't show up. I've tried....
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]