我想使用 swiftdata (ryanfowler) 在 swift 2 中使用 sqlite 但有 120 个错误,我该怎么办?

I want use swiftdata (ryanfowler) for using sqlite in swift 2 but there is 120 errors ,what shouild i do?

我尝试使用 SwiftData [1]: http://ryanfowler.github.io/SwiftData ,当将它导入我的项目时我有 120 个错误,其中一些是关于 println 的,我如何解决另一个错误?我添加了字符串扩展但错误仍然存在

the authors' git可以看出最后一次提交是一年前; Swift数据不符合 Swift 2。例如。您看到的 println 错误是因为 println 随着 Swift 的发布而更改为 print 2. 除非您想将 Swift 数据移植到 Swift 2 你自己,你真的不能简单地解决这个问题。

但是,现有用户似乎已经看过这个,请参阅以下线程中用户 RegisStGelais 的帖子:

要获得完整的 Swift 2 更新版本,请参阅 github 用户 Lopdo 的这个分支:

如果对从原始 Swift 数据执行的更改感兴趣 -> Swift 2 兼容,请参阅 Lopdos commit


或者,在此处查看 SwiftData 的修改和扩展的 Swift 2-ready 版本:

This is a heavily modified version of SwiftData.swift by Ryan Fowler

This has been enhanced to support custom files, correct binding, versioning, and a streaming results via Cursors. The API has also been changed to use NSError, Cursors, and to force callers to request a connection before executing commands. Database creation helpers, savepoint helpers, image support, and other features have been removed.