Refactoring the GUI for an Xcode App
Friday, January 30th, 2009I have been having a blast refactoring the GUI of my Poission Equation solver - Potentials, using Xcode. I had a very simplistic interface in the beginning because I wanted to focus on the math involved, and then never really took the time to mess with the GUI as I realized that I didn't have access to a really good graphing package with which to display the results.
With CorePlot on the horizon, I got interested in it again and decided that the simplistic view of the app needed an update. I had a simple text field for the input file name, a "Go" button, a status label and a text field for log messages. Problem is that the solution is so fast, there's no need for the log text area as the status line will be fine for user feedback.
So I decided to make the app an editor of the source file and headed in that direction. I was very happy to see that I had already really laid down about 80% of the necessary code for this, and there were only a few things I needed to change. When I started to edit the MrBig.h header to include more outlets and actions I was stunned to see that InterfaceBuilder automatically re-parsed that header and added in the actions and outlets to it's representation.
That was a real treat. In the past, you had to manually ask for that to be done and it was always a touchy process that could get you into trouble if you didn't format the actions and outlets properly. Now, with the IDOutlet and IBAction descriptors, it's easier for IB to figure all this out.
Amazing tools, and lots of fun to work with.