Realm Swift Bundle Data

前端 未结 1 1282
日久生厌
日久生厌 2021-01-27 17:33

I converted a csv file to a realm file and I want to use it in my app. This is my code atm:

func inLibrarayFolder(fileName: String) -> URL {
    return URL(fil         


        
相关标签:
1条回答
  • 2021-01-27 17:59

    When it comes to importing, the file being imported has to be in a very specific format along with a specific file name

    Your Realm object name is Tree, so the imported file name needs to match

    Tree.csv
    

    along with that the first line of the file needs to match the classes property names, comma separated

    id,br,nm1...
    

    I would suggest creating a very small test file to import with 3-4 lines to get it working. Then, once you mastered that then import the big file.

    0 讨论(0)
提交回复
热议问题