Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
So, i just want to know what the best way to display image from URL.
I have to display few post from the server into my iOS app using UITableView with title and image in it.
I had already created the WebServer for my app and fetching is done through TBXML and using Core Data to store the title and description from the server.
and i saw some library available to cache the image like https://github.com/path/FastImageCache
Now my question is that how can i display image from the URL ?
And what is the best method to do it.
Thanks
The best way is to write your own code. Using a library will work but it will be generic and by definition slower than what you can write for your specific use case.
You are far, far better off learning the few lines of code it takes to download an image and display it. Learn how to use a NSURLSession. Learn how to consume NSData and turn it into a UIImage. Learn how to use a NSNotification or a block to propagate the loaded image to your user interface.
Your code will be stronger and you will become a better developer.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I would like to know what are the best practices regarding, Modeling data when no network connection available, if the app you are building is cloud computing based, but still you want to be able to have basic functionality and I guess some persistent data?
PD: I am kind of new to IOS development
UserDefaults is okay for small bits of data that don't change often, but as it has to rewrite the entire user defaults dataset to a file each time a change it made, it is not robust enough for anything of volume or with frequent changes. For that you would want CoreData or a third party open source solution like Realm.io.
You can try to using the 'cache' where you store temporary data.
One way to achieve this is NSUserDefaults where you set a variable (let's say users profile photo) and when the user opens his app again, the image will be loaded even if there is no internet connection since its cached. Hope this helps!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm working on an app with quite a few images and general information about them. Are there any general guidelines about when it is a good idea to just bundle the data with your app and when it should just be downloaded on first run? When you should use Core Data and when just keyed archiving is sufficient? Or is there a better solution I haven't even considered?
I imagine that the data will be updated from time to time, but not frequently. I'd like the app to be able to download updates.
Kind of a vague question, and I apologize for that.
It depends on whether the initial data (images & information) is important and always the same.
If you wish to have it dynamically changed to whatever is updated on the server then you shouldn't bundle it within the app. On the other hand, if the initial data is trivial and you can just include it in the app.
Now if you wish to store the initial data locally in the app, given that the data is just images and theirs information, I would recommend to just use keyed archiving to keep things nice and simple.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm creating a social media app.
I want to know a way to cache a users profile picture once downloaded from the Parse network and then each time the app is loaded check if an updated picture has been found and load that one, then cache that one.
I have no idea how to approach this, does anyone have any ideas?
There are plenty of third-party libraries for caching you can find on Github, or you can simply use NSUserDefaults or CoreData to save the pictures(or really anything) to disk. To check if a picture was modified, you can give the picture an identifier, compare it with the response from the server, and re-save the picture, or do whatever is needed.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hi Im currently developing an app where I have some text which informs the user about something. This information is also on my website and what i want to do is when i change the information on my website I also want the text in my app to change. I know that you can create a backend tableview with for example parse but that's not what Im looking for. I've done som research and think what i need do to is use JSON in some way to display the text from my website in my app. Pleas comment If you don't understand what It s that Im trying to accomplish. If you could either link a tutorial or explain how/if this is possible I would appreciate It very much!
you can make a json call from your app to a url and have a script or file in your website that returns the information you want, this will make it easy to change it in future. then use the same script as the basis ( again using a json call) to get the text for the specific webpage.
It's difficult to answer more specifically since you've mentioned no technology base for your website.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
My app has to integrate uploading image to set it as profile picture. The thing is all the images has to be stored in web services.
As web service has not been yet created. what is the best way to store images for temporary purpose so that i can integrate it easily when i have been provided with the backend.Sample tutorials can be helpful
My best idea is to use FTWCache (https://github.com/FTW/FTWCache) and cache it localy. Later, using webservice, you can still use your already written cache mechanism to implement NSURLConnection with caching. Profit! ;-)