vendredi 7 août 2015

iOS: How do I save an NSURL in an SQLite database?

I have a schema like this

CREATE TABLE table(_id integer primary key, orig_url text, new_url text)

and I want to save NSURLs – or their string representation – in this database. Assume I have strings like this:

assets-library://asset/asset.JPG?id=F658E5E1-6449-4674-85B5-2F2EC3C72A00&ext=JPG

The trouble is, I know little of SQL or sqlite and the URLs include characters which must be escaped.

What is the most straightforward way to insert such strings into the database and get them out unescaped?

Aucun commentaire:

Enregistrer un commentaire