0

I have a working version of my code using TableViewDataSource, but I want to transition it over to using NSArrayController. The code is for an interaction tracker that I'm working on for a project. It is a little messy so I know it needs some cleaning up. I technically have 2 issues.

  1. I have to populate the instance and then manually add the instance of my Interaction class to the interaction Array. In coding examples that I have tried to follow, they use bindings to do this without calling [MutableArray addObject:thing]. I would prefer to remove the populate instance button and just submit. I have a decent number of the bindings working for me, but I'm missing something.

  2. After I populate the instance and submit the interaction, 2 entries appear in the Tableview. One is blank with only the interaction number filled in. The second is all the information that I populated in the instance. The double posting repeats every time.

screenshot

My questions: 1. Can I modify/override the add: action on the NSArrayController to fulfill a more custom approach? 2. What could be causing the double posting?

The code is rather large at this point. If someone is willing to look at it and let me know where I'm off, I'd really appreciate the help. I can send the code your way as well. Edit: Here is the code in a zip

Moobius
  • 43
  • 5
  • 1
    1) You can create your own action method to be called with an "add" button, you don't need to hook it up to the array controller's add method. Somewhere in your method you will need to call the array controller's add or addObject: methods. 2) Hard to tell without seeing your code. – rdelmar Aug 13 '12 at 04:11
  • I think that the double submission and the add piece are linked. I assume that i would need to declare a NSArrayController instance in order to interact with the add object method, correct? – Moobius Aug 13 '12 at 04:59
  • Yes, I thought you were already using one. – rdelmar Aug 13 '12 at 05:05

0 Answers0