0

As I said in title, i want to release an app with preloaded data. The problem is that : I have no idea how to do this in right way.

For the moment, i have in my mind only one though : To save all dates i want to be preloaded, and after that i will put the .storedata file in application resources folder, and, at first run i will replace the generated .storedata file.

That's how i think to take the location of .storedata file.

 let appSupportDir = NSFileManager.defaultManager().URLForDirectory(NSSearchPathDirectory.ApplicationSupportDirectory,
            inDomain: NSSearchPathDomainMask.UserDomainMask,
            appropriateForURL: nil,
            create: true,
            error: nil)
        let error = NSErrorPointer()
        let supportDir = appSupportDir?.path
        var  supportDir  = "\((appSupportDir?.path)!)/com.MingleBit.MyAppName/MyAppName.storedata"
        var man = NSFileManager.defaultManager()
  //    var att = man.attributesOfFileSystemForPath(apppp, error: error) // get .storedata file attributes

Do you have a better idea to import that data ? It's wrong if i will do that as I said above ?

Thanks for help!

C-Viorel
  • 1,801
  • 3
  • 22
  • 41

1 Answers1

0

You have to preload it by using a xcappdata file. There is a great tutorial on this site which shows step by step, what to do.

Christian
  • 22,585
  • 9
  • 80
  • 106