CS193p Assignment 2 thoughts
In this post I gather some thoughts on the assignment 2:
- protocols - for the iPad application to work one has to define a protocol in a separate-file. I just followed the directions in the lecture, but I am still at a loss how this works;
- error handling - in one of the earlier assignments one had to implement some error handling (division by zero). This should also propagate to the Graphing Calculator, which I did not implement;
- Points vs. pixels - the assignment asks to use this conversion in order to have the app working on retina displays. So I added this scale factor and thus doubled the number of calculations. However it does not seem to make any difference. So I am lost here;
- drawing mode - I had some problems implementing the drawing mode (line vs points). I added a segmented switch to the iPhone and iPad GraphController views. These call a method drawingModeChanged in the GraphController, which in turn changes the corresponding instance variable in Graph. But I was not sure in what method to set the drawing mode. After some experimenting I found the right one (tell you later which one);
- Xcode crash - I experienced a heavy Xcode crash. The application would no longer star with my project. I tried to use Time Machine to get a valid version back, but that did not work. So I recreated the project and pulled in the old files one by one. I was able to pull them all in without any problems. So I guess one of the project-files got corrupted;
- Profile - the final part of this assignment involved optimizing the code for the pinching gesture. I did not finish this, as it seemed to involved a lot of rewriting. I guess that one has to use a CGContextScaleCTM to change the scale;
Page 1 of 1 pages