Closed holgersindbaek closed 11 years ago
You can load the file using standard Cocoa (string = NSString#stringWithContentsOfFile:encoding:error:
), parse it with something like my_hash = BW::JSON.parse(string)
, and then initialize your Publication
object with Publication.new(my_hash)
.
Awesome thanks. I'll give it a shot. — Sent from Mailbox for iPad
On Sun, Jun 23, 2013 at 11:40 PM, Clay Allsopp notifications@github.com wrote:
You can load the file using standard Cocoa (
string = NSString#stringWithContentsOfFile:encoding:error:
), parse it with something likemy_hash = BW::JSON.parse(string)
, and then initialize yourPublication
object withPublication.new(my_hash)
.Reply to this email directly or view it on GitHub: https://github.com/clayallsopp/maglev/issues/11#issuecomment-19887753
I need to load the JSON from a file on the device, instead of from the internet. How would I go about this with Maglev?
My JSON look like this:
I have 3 models:
How would I go about loading my JSON from a file instead of an url and how would you go about linking it up to the models when my JSON file doesn't have a /publications extension?
Is this even possible with Maglev?