• 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
Bindings Concept Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings Concept Question


  • Subject: Bindings Concept Question
  • From: "Alex Wait" <email@hidden>
  • Date: Fri, 20 Jun 2008 22:16:55 -0700

I know this is probably a really basic question about binding but it's sure
tripping me up right now.

I am making my way through "Cocoa Programming for Mac OS X" by Aaron
Hillegrass. It's an excellent book btw.

However the first time he has discusses binding is in the context of a
NSDocument arch.

I am trying to make an app on my own. On the window I have a TableView with
two columns, two edit fields, and a button.

My desired behavior is for the user to type in both of the fields, click the
add button and poof it appears in the table.
I have done this exercise before but I made my AppController class the
dataSource and provided the methods. I would like to this time use
the NSArrayController to handle it for me.

Right now I have NSArrayController "binded" to App Controller and the
"arrayOfData" array. In my init method for Appcontroller,
I add one "Data" object (which contains two strings) to my NSMutableArray.
This array is the array that my ArrayController is bound to.

When the app starts, I see the data as expected. However, when I call my add
function, which gets the strings from the textFields and makes the
new "Data" object and adds it to the array, I do not see it in the table.

I tried calling the table's reloadData function but that did not work. (I
bounded it of course and I threw in a check to make sure it's not nill with
a NSLog to prove it to me)

What am I doing wrong?

--Thanks for reading this fairly long winded post. I am greatly enjoying
this new methodology of Cocoa programming. It's very exciting and I am eager
to learn more!

Alex Wait

--
If you can't be kind, at least have the decency to be vague.
_______________________________________________

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

  • Follow-Ups:
    • Re: Bindings Concept Question
      • From: mmalc Crawford <email@hidden>
    • Re: Bindings Concept Question
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging
  • Next by Date: Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging
  • Previous by thread: Bindings on Custom View (Initial Value)
  • Next by thread: Re: Bindings Concept Question
  • Index(es):
    • Date
    • Thread