I’ve been muddling through some iOS development, and I’ve hit a problem that Google hasn’t helped me solve (yet).
What I’m trying to do is simply display text files in a UITextView. The displaying is easy, it’s the source of the text files that is more difficult. What I’m planning on doing is writing a text file weekly and then having that text available in my app, I’m just not sure what the correct approach to storing and retrieving that text is. Here is what I’ve thought about:
1) Storing the text files within the app. I don’t like this because I’ll have to provide application updates frequently or have a whole slew of text documents available for each update.
2) iCloud. I don’t even know where to begin with this one…
I’m not looking for code samples unless someone has done something very similar to this previously. I’m more looking for suggestions on how I might be able to store a text file (that I write from my laptop) and have that text file available to everyone who has my application installed.
Any thoughts? Thanks in advance.
All you need is to store your text file somewhere that it will be publicly available. (try any file hosting service or maybe buy a basic hosting plan) To retrieve the data, all you need to do is call it with NSString’s
Be sure to provide the correct URL and I guess the encoding would be NSUTF8StringEncoding.