dingbat/nsrails

CoreData Example

winfred opened this issue · 2 comments

Upon mucking around with a little bit of offline stuff, I decided it'd be a good idea to turn the existing example into a CoreData enabled thing. I am starting out with something super basic where the posts can be viewed even when the device is offline.

Certainly my issue has more to do with my lack of understand for CoreData. (Open the UIManagedDocument, set NSRConfig's default context, call Post remoteAll... and that should be it to persist it into the DB, right?) For some reason only 'null' values are getting stored, so upon going offline and restarting the app, the table cells are populated with empty strings although there is a correct number of empty entities in the database.

I know I'm flirting the scope of the project a bit, but in general a CoreData example might be helpful if it's something that wouldn't take a more experienced person long to put together. (or if I can get my head around this stupid thing)

Anyway here's what I've got so far on my CoreDataDemo branch.

Hey, sorry for the delay.
Been busy with getting the huge new version of NSRails out. And with HS graduation :)

Thanks for the demo. Haven't checked it out yet (will do tomorrow) but did you manage to get that weird issue resolved?

Hey, not sure if you're still using this library at all or what, but it's been since updated with a new NSRRemoteManagedObject class for CoreData. Everything should work as you described.

Since it's so old I'm closing this issue, lemme know if things still aren't working.