1 class Venue < Nitron::Model 2 # CoreData requires that every fetch be ordered somehow. 3 def self.all 4 order("due") 5 end 6 7 # We're using a text field to display a date when data binding. 8 def due 9 primitiveValueForKey("due").to_s 10 end 11 end
(main)> Venue
=> Venue
(main)> Venue.new
2013-05-09 16:32:59.051 Beers[7036:c07] app_delegate+core_data.rb:27:in `block in managedObjectModel': uninitialized constant Kernel::Event (NameError)
from app_delegate+core_data.rb:25:in `managedObjectModel'
from model.rb:25:in `entityDescription'
from model.rb:50:in `new:'
2013-05-09 16:32:59.124 Beers[7036:c07] model.rb:50:in `new:': NSInvalidArgumentException: An NSManagedObject of class 'Venue' must have a valid NSEntityDescription. (RuntimeError)
=> #<RuntimeError: NSInvalidArgumentException: An NSManagedObject of class 'Venue' must have a valid NSEntityDescription.>
--
---
You received this message because you are subscribed to a topic in the Google Groups "RubyMotion - Ruby for iOS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubymotion/FlEnCIcSi4w/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to rubymotion+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I created a directory named db and touched beers.sqlite, so the file should be accessible. Is that the correct way of initialise a db?(main)> BeerStore.load{"name"=>"Chimay", "homepage"=>"http://en.wikipedia.org/wiki/Chimay_Brewery", "lat"=>"4.316667", "long"=>"50.016667"}2013-05-12 13:28:18.897 Beers[19382:c07] beer_store.rb:69:in `initialize': Can't add persistent SQLite store: Error Domain=NSCocoaErrorDomain Code=512 "The operation couldn‚Äö√Ñ√¥t be completed. (Cocoa error 512.)" UserInfo=0x155f0aa0 {reason=Failed to create file; code = 2} (RuntimeError)from beer_store.rb:4:in `shared'from beer_store.rb:44:in `block in load'from beer_store.rb:43:in `load'=> #<RuntimeError: Can't add persistent SQLite store: Error Domain=NSCocoaErrorDomain Code=512 "The operation couldn’t be completed. (Cocoa error 512.)" UserInfo=0x155f0aa0 {reason=Failed to create file; code = 2}>
https://github.com/stabenfeldt/RubyMotionSamples/blob/master/ios/Beers/app/models/beer_store.rb#L69
You received this message because you are subscribed to the Google Groups "RubyMotion - Ruby for iOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubymotion+...@googlegroups.com.