Array+ TableView Help

Discussion in 'Mac Programming' started by CaptainZap, Jan 8, 2008.

  1. CaptainZap macrumors regular

    Jan 17, 2007
    I'm creating a new application, and in this application there is a class called Student which has an array as an instance variable. And I'm going to use an Array controller to add and remove them and display them using a table view. Like this...
    Screenie -

    If you are still confused -
    Say I have an array that has {Bob, Susie, Bill} in it, and I want them to be displayed in the table view horizontally like
    | Col 1 | Col 2 | Col 3
    | Bob | Susie | Bill

    And I can't figure out what Model Key Path I need to return the object in the array at the index of the row. Help? =]


    Alright, I know how to do it with identifiers and without key paths but that takes a lot of code and I still want to figure out how to do it with Key Paths =D
  2. kainjow Moderator emeritus


    Jun 15, 2000
    I'm not sure if you can do this with bindings since each row is represented as an object within an array, and each column is a property of that object. You could definitely do it without bindings, and yes it would take a lot of code, but not that much :)
  3. CaptainZap thread starter macrumors regular

    Jan 17, 2007
    Yah, I ended up just using identifiers and it works fine, just might not be the best solution. And it only took 6 lines of code for the whole thing.

Share This Page