sxross/MotionModel — pull request #3 by royw (2012-09-09 20:38:57+00:00)
Title: work on persistence

Howdy Steve!

I did a little work on your Model persistence, including expanding the spec a little. While this is working under spec, it is still failing in my app:

iBCC(16386,0xacd39a28) malloc: *** error for object 0xde61214: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
2012-09-09 15:24:07.812 iBCC[16386:c07] model.rb:283:in `serialize_to_file:': Error when writing data: # (MotionModel::PersistFileError)
from ManagersController.rb:37:in `viewWillAppear:'
2012-09-09 15:24:07.813 iBCC[16386:c07] *** Terminating app due to uncaught exception 'MotionModel::PersistFileError', reason: 'model.rb:283:in `serialize_to_file:': Error when writing data: # (MotionModel::PersistFileError)
from ManagersController.rb:37:in `viewWillAppear:'

I think this related to your question on the rubymotion group as it appears to me that archivedDataWithRootObject just doesn't like an array of class instances under some circumstances.

I added a .rvmrc and Gemfile (I tried bubble-wrap and sugarcube's persistence without success) which you may just want to decline.