Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Vermeer, Edwin authored and Vermeer, Edwin committed May 7, 2017
1 parent 5fdce71 commit 7df41ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Binary file not shown.
6 changes: 5 additions & 1 deletion Source/CoreData/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Then creating an instance in your database based on a json string will work like
let moc: NSManagedObjectContext = EVReflectionTestsData().moc // Your code for getting the NSManagedObjectContext.

let obj = CoreDataPerson(context: moc, json: "{\"firstName\" : \"Edwin\", \"lastName\" : \"Vermeer\"}")

do {
try data.moc.save()
} catch {
Expand All @@ -69,7 +70,10 @@ do {

Parsing an object array is just as easy:
```swift
let arr = [CoreDataPerson](context: data.moc, json: "[{\"firstName\" : \"Edwin\", \"lastName\" : \"Vermeer\"},{\"firstName\" : \"Edwin 2\", \"lastName\" : \"Vermeer 2\"}]")
let moc: NSManagedObjectContext = EVReflectionTestsData().moc // Your code for getting the NSManagedObjectContext.

let arr = [CoreDataPerson](context: moc, json: "[{\"firstName\" : \"Edwin\", \"lastName\" : \"Vermeer\"},{\"firstName\" : \"Edwin 2\", \"lastName\" : \"Vermeer 2\"}]")

do {
try data.moc.save()
} catch {
Expand Down

0 comments on commit 7df41ac

Please sign in to comment.