0

I get this compile error:

   Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 1

with this function:

   func saveChanges()->Bool {
    var path = self.itemArchivePath()
    return NSKeyedArchiver.archiveRootObject(self.someArray, toFile: path)
}

Any thoughts?

bhzag
  • 2,932
  • 7
  • 23
  • 39
  • I see `Xcode6-Beta.app` in the path to `swift`, which is the very first beta apple released. You should definitely upgrade to the lates version. (As of today that is Beta 2) – Stefan Arentz Jun 28 '14 at 22:09
  • Do you get a more specific error from the compiler or does it just crash during compilation? (See my previous comment) – Stefan Arentz Jun 28 '14 at 22:29

1 Answers1

-2

It is because NSKeyedArchiver need an NSArray instead of NSMutableArray

func saveChanges()->Bool {
    var path = self.itemArchivePath()
    return NSKeyedArchiver.archiveRootObject(self.someArray as NSArray, toFile: path)
}
Kuroro
  • 1,841
  • 1
  • 19
  • 32