mutualmobile / MMRecord

Seamless Web Service Integration and Core Data Model Population
MIT License
691 stars 76 forks source link

load data from url #118

Closed engmohamedsalah closed 8 years ago

engmohamedsalah commented 9 years ago

I want swift example to load from url that which return json format list I have model class Book: MMRecord { @NSManaged var author: String? @NSManaged var name: String? @NSManaged var arabicName : String? @NSManaged var catName : String? @NSManaged var logo : String? @NSManaged var noOfPages : Int @NSManaged var noOfDownloads : Int @NSManaged var path: String @NSManaged var language : Int
}

and I want to do this Book.startRequestWithURN("https://myURL/" , data: params, context:managedObjectContext, domain: self, resultBlock: {records in var results: [Book] = records as! [Book] println("success")
}, failureBlock: { error in println("Error = ") completion(result:nil,error: error)

    })

I did this but I got no response for long time

cnstoll commented 8 years ago

I'm going to close this mostly because of the time that's elapsed, which I apologize for, but for future reference, remember that it's critical to setup MMRecord with an MMServer implementation for everything to work correctly. If you're not getting a response, then that's likely the first place to look.

I would also add that while MMRecord has been basically tested in Swift, it has not been extensively used in a Swift project. We also haven't updated the Swift sample project in some time, and due to the evolving nature of the language the sample is there more as a reference now.