I had this today and found a few things that if I switched to a different simulated device it was fine.
At the same time the canvas was not refreshing; after I quit both Xcode and the simulator and restarted the problem went away.
I suspect it's something to do with the simulator running the code for the canvas and trying to run the same code in a simulated device.