mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Importing Array #139
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @martheli on GitHub (May 27, 2017).
I have an array like this:
let array = ["John", "Maria", "Erika", "Susan"]And I would like this array to be imported into my Persons entity. I have read the README in regards to importing arrays and I am not sure if just using the below is sufficient?
I am getting "Ambiguous reference to member importObject" error. Am I supposed to add the following class to my project before the import works?
@JohnEstropia commented on GitHub (May 28, 2017):
Yes, you will need to implement
ImportableObjectorImportableUniqueObjectmethods first.You can only import from the type you declare
ImportSourceas. For example, if you setyou can import a single object with
and multiple objects with
@martheli commented on GitHub (May 28, 2017):
Whenever I use the following, I get error that says "Typealias is missing an assigned type":
@JohnEstropia commented on GitHub (May 28, 2017):
The typealias needs to be implemented in your class. Please read the Swift documentation on
associatedtype.I would suggest you familiarize yourself first with Swift and Core Data in general as CoreStore's documentation assumes you have sufficient background on both.
@martheli commented on GitHub (May 29, 2017):
Do any of the demos that you attached, include a sample of how to import data from JSON?
@JohnEstropia commented on GitHub (May 29, 2017):
Sorry, there's no demo code for importing yet. But the Unit tests do have a sample code you can refer to: https://github.com/JohnEstropia/CoreStore/blob/develop/CoreStoreTests/ImportTests.swift#L1068
By the way, for general questions/discussions you may want to join the CoreStore Slack group:
http://swift-corestore-slack.herokuapp.com/