Hey guys. I'm new to Xcode and Objective C and I'm writing my first application, and learning how everything works. I have decent experience in C/C++ and quite a bit of experience in Java and Eclipse now, and so far everything has been coming along quite nicely. I do have a few questions though, and I was hoping some people on here could give me a hand.
My application is pretty simple, but I'm using it to learn how to do more complex things in the future. So far I have a table view and two buttons in the MainMenu.xib file, where I see a list of custom objects. I'm pretty well versed in object orientation and how to implement them in C, so I've got no problems there. The two buttons are to add and remove an instance of this custom object, and show everything in the table. As per Apple's recommendation in their documentation, I created a new xib file for the add window, where the user fills out a bunch of fields and presses a go button at the bottom of this second window. The second window closes and the new object instance is saved to an array of these custom objects and then of course shown in the table.
Or at least that's what I'm going for. So far I have both windows ready to go, they look great. I've got some basic functionality going (some fields enable/disable depending on the option selected in a popupbox and so on) in each window but I need help joining all the parts together. Right now, the add and remove buttons don't do anything. I would need the add button to load this second window nib file and display it, and then the go button in this window would need to send a copy of this object to the array in the first window. Would I need to use an arraycontroller to keep track of this? How could I get the two xib/nib files to talk to each other and send objects back and fourth? I'll need an edit button as well that pulls up a version of this same window, but has all the fields already filled out with the values from the already created object for editing.
I'm so used to coding everything out and not using something like IB to do most of the "glue code" as they call it for me. While I much prefer the Apple way of doing this, I just don't know how it all works together. Hopefully there are some people on the message board here with enough patience to give me a hand!
My application is pretty simple, but I'm using it to learn how to do more complex things in the future. So far I have a table view and two buttons in the MainMenu.xib file, where I see a list of custom objects. I'm pretty well versed in object orientation and how to implement them in C, so I've got no problems there. The two buttons are to add and remove an instance of this custom object, and show everything in the table. As per Apple's recommendation in their documentation, I created a new xib file for the add window, where the user fills out a bunch of fields and presses a go button at the bottom of this second window. The second window closes and the new object instance is saved to an array of these custom objects and then of course shown in the table.
Or at least that's what I'm going for. So far I have both windows ready to go, they look great. I've got some basic functionality going (some fields enable/disable depending on the option selected in a popupbox and so on) in each window but I need help joining all the parts together. Right now, the add and remove buttons don't do anything. I would need the add button to load this second window nib file and display it, and then the go button in this window would need to send a copy of this object to the array in the first window. Would I need to use an arraycontroller to keep track of this? How could I get the two xib/nib files to talk to each other and send objects back and fourth? I'll need an edit button as well that pulls up a version of this same window, but has all the fields already filled out with the values from the already created object for editing.
I'm so used to coding everything out and not using something like IB to do most of the "glue code" as they call it for me. While I much prefer the Apple way of doing this, I just don't know how it all works together. Hopefully there are some people on the message board here with enough patience to give me a hand!