I’ve really enjoyed working through the book so far but now I’m stuck on chapter 17 challenge 1 and seem to be going round in circles.
The good news is that I do understand how the TouchTracker code works but in adding saving and loading of the line data, it seems bad practice that the data is being stored in the view. So I thought that linesInProcess and completeLines should be either in the TouchTrackerAppDelegate or in a view controller. I managed to add a view controller with xib (TouchDrawController) and that works fine but I don’t really know where to go from here. Some questions:
- I’ve moved linesInProcess and completeLines from TouchDrawView into TouchDrawController and added both of these as properties.
- How can TouchDrawView now access these variables as it did with a line such as
I couldn’t see any obvious way for a view to get its view controller.
3. Where do you draw the line regarding a method like clearAll? Should that remain in the TouchDrawView, or (as it seems to be more about the data than the view) should it also be moved to TouchDrawController? Or doesn’t it really matter?
many thanks for any enlightenment!