marcoarment / FCModel

An alternative to Core Data for people who like having direct SQL access.
MIT License
1.65k stars 173 forks source link

Not safe to persist NSURL using absoluteString() for file URLs #99

Open BennettSmith opened 10 years ago

BennettSmith commented 10 years ago

When persisting an NSURL to the database it is not safe to simply convert it to an absolute string and store it. If the NSURL is storing a file URL then the resulting string will not work to reconstruct a valid file URL. Instead, it should persist to disk as a bookmark in a BLOB. Since the field type would differ based on whether the NSURL is a file URL or not I am unsure how to fix this.

johncblandii commented 10 years ago

Are you saving the entire path or just the file path within the app directory?

The latter is how I'm doing it with no prob.