june 27
segmented control is not working
Segmented controls work for buttons but look ugly.
Found out that it is possible to have multiple buttons on a nav. Was confused for a long time because there is apparently no good way to make multiple buttons in storyboard. (There are some ugly hacks.) Yet multiple buttons is trivial in code.
Lesson: storyboards only ever offer a curated selection of the features that are used most often and are easy to set.
note
keep track of what input is given in completion handlers
test
see if MailGen is now working (except for saving Draft obviously)
is nice
changed protocol.
now the cancel button doesn’t work.
do i enter didFinishWithResult ?
oddly if I put a breakpoint into didFinishWithResult then it crashes but no breakpoint == no crash
ok
now header files should display the right date
reminder:
we cannot print out array in the debugger
attempting to print out an *optional* array results in the weird error message “Array index out of range”
q
why are there 12 Vert objects?
q
why are the managed objects in core data appearing multiple times ?
possible reasons
- fat finger
- test code gets run before everything and adds its own elements
I don’t see how testing could do this…
q
If I clobber the file does this change to 4?
ans
yes
note
using an optional type where an optional is needed will potentially cause failure
q
Why did it get changed to optional when I already it working as non-optional ?
result
turns out that the main problem was that I was assuming debugging output would be valid. Debugging output is garbage.
note
only a single window is used to present content on the screen (it is an example of a singleton in IOS) and the app delegate has access to it.
note
have many debuger launch failures today
note
root view controller is not equal to the view controller that gets presented at launch.
note
storyboards confuse the issue of initialization and class construction.
The only storyboard element that gets an init is the root view controller.
All storyboard elements are visual representations of classes. They are templates.
note
instantiateViewControllerWithIdentifier
q
Clearly saving sometimes works for some things.
It could be that:
saving works on all properties but only the first time I do it
saving works only on some properties but does so every time I call saveContext()
I want to look at the x,y positions before and after manipulating the graph to help me decide which is true.
This failed of course because the problem is that the graph is always started in the same place.
note
Don’t assume what is given by apple will actually work. It might be something that worked at one time but the recent changes have broken it.
note
the problem seems to be that hasChanges is false; I’m double checking that however
note
the problem is that the contexts are different. So I will set a point to see the call stack when this change happens.
the reason that multiple contexts were being created is that I was instantiating the thing in app delegate. It is easy to instantiate multiple copies of a class and then reference the wrong one.
problem
Sometimes it is not possible to close a running instance in xcode.
note
start treating the build button like a resouce. Hit it less. Sometimes swift compile is reasonable but it can be deathly slow i.e. 1 minute for a minor change.
note
added a breakpoint to test if no savedUsers are found