Wednesday, 10 June 2015

June 8 2015

Cannot invoke getVertViewById with an argument of type Int32
lazy may not be used on an already-lazy global

note
swift: dealloc is now deinit

“graph does not have a member named moveVertById”

Currently working on GraphExtension
4 errors in GraphExtension = 10 mins

fix moveVertById. 
a 3 argument method that is supposed to be called on graph.

note
it is safer to have 

note
do not expect the compiler to fare well when you try to do advanced things like adding two numbers within a method call

note
In objective C you can only ask an object “Is your class X?"
In swift you should be able to ask an object “what is your class?”
but I have never actually done this.

for some reason circSize and edgeSize are not CGFloats

8:30pm
currently working on VertView

note
when you see code you need to see it in tandem with the markers 

note 
what is the type of array.count

note 
With value types there is usually no good reason to use as!. 
Instead you instantiate one value from another. 

task 
modify moveVertById

note
working inside graphWorldView

note
You will never be harmed by making all data an optional variable.

task
check if drawEdges is getting trigged.
result
yes

task
check if X1<X2 is getting triggered
result
the error was that I was checking if v and w were in the same place rather than in different places

problem
only three of the four verts are being drawn

task
examine the breakpoint set after edgeFrame and see how many times it gets hit
1

fact
when an observation of a vert is made the finishedObservedMethodFlag has been set on that vert. 

fact
Four observations are made for the test graph. There are 3 ways that the method could fail to work. The keyPath could be wrong. The graphView could be nil. The views of the vert might not be fresh. 

fact
all the verts have working key value observers. 

task
remove the print statements that are being used.
results
the print statements are not in GraphWorldView

issue 
edge view is nil in drawEdges2

task 
add logic to prevent edgeViews being set as not fresh if there are no edges in the vert.
This will happen in Edge cat.

done
there is now a breakpoint right after the edgeView call. 
There is one within the edgeView as well but within the loop.
If we don’t get to this breakpoint I can be certain that’s where the problem is. 

note
there is no good reason for using auto-unwrapping. 

note
after removing auto unwrap from e I have not solved the problem.
I am point inside of the else block

done
removed setNeedsDisplay on addVertAtPoint

note
in some more advanced swift frameworks the type used in objective C will be different. Often you pass in a string instead of just the name

note
think the problem is 
(1) EdgesViews being drawn after VertViews so 

(2) that I was not pushing the view back in the 

No comments:

Post a Comment