How to save webcontent and images in objective-c iPhone app? - objective-c

Requirement of my project is, if device have internet connectivity, need to get the content from server and show it in UIWebview, other wise get conent from local. For that i have stored xml content to sqlite, i don't know how should i save the images which comes in HTML NODE to local. can any one help me out.
Thanks
sri

You are getting url of the image. You can create the documentdirectory and save the images in that directory. http://developer.apple.com/library/ios/navigation/index.html?section=Resource+Types&topic=Sample+C#section=Resource%20Types&topic=Sample%20Code from this url you can find Apple sample code regarding url connection

Related

VB.net - TcpListener based Web server

I built in vb.net one webserver from this how-to: http://www.java2s.com/Tutorial/VB/0400__Socket-Network/TcpListenerbasedWebserver.htm
The code works fine reads the html but I can not understand why not showing images. Any suggestion?
Downloading the HTML of a webpage will absolutely never download any kind of secondary elements/files, including images.
In order to get the images, you'll need to get the images URL and download them separately.

iOS app files that the user can download from the app

The idea is that i will create a file in the app and store some data in it.
I want for the end user to be able to download that file from the iOS device to his mac/pc.
Is this somehow possible? Where should i put the file for the user to be able to download it via itunes?
Here is good tutorial you can use:
Tutorial
It is important to know, that in iOS, when your user needs to create file, you do not need to care where to save it.
Another possibility for you might be to avoid saving data as file. For example, if your data is picture:
UIImage send to email

How can I add binary image to photo gallery using objective-c

I am creating app to display image from web services on iPad
I use FGallery to create photo gallery on my app and I retrieve binary image form web services and convert it to UIImage.
How can I add images to FGallery?
I am hoping that someone out there might have a solution that can perform this task, or if anyone could point me in the right direction, I would really appreciate it!
FGallery is current written to load images from the application bundle or web server via URL. Because you cannot change the application bundle at run-time, you will need to change FGallery to read images from <Application_Home>/Documents/ folder. Once that is accomplished, you will then save your new UIImage to the application documents folder and update the NSArray *localImages in the RootViewController.

Where are the PDF files in iPhone ? Can I load them in an app?

I want to make the user of the app I'm developing, able to load a PDF file from his device as if he was loading an image from the gallery.
Is it possible and if so, where are the PDF files ?
Thanks a lot for your advices
I think that isn't possible, see that: https://stackoverflow.com/a/7778719/1451392
No, it's not possible. Every application has its own memory space (.app folder) which it can access (plus some special folders like the image gallery).
You can access your share of memory via [NSUserDefaults sharedDefaults].

How to load an image with unique names from a private folder?

I am working on an app for iPad where I want to have lets say 100 jpg's in a folder.
They could be named like 01.jpg, 02.jpg etc.
In my app I like to browse those images and when clicking on one of them I need the name of the image to be able to send some data over the network (the data part works fine).
I tried to use UIImagePicker but I found out there are no name connected to the actual image.
Then I made another approach where I have a number of pages where I have buttons and here I load in the images which works fine as long the are a part of the recourse of the project...
But here comes the real problem.
The user of the app should be able to change those images over time without recompiling the app.
So I do look for a way to have a folder where the user can place/replace images with the names 01.jpg etc and the app to use those updated images.
Ideas are very welcome.
Wiljan
I am not sure that I understand what you mean, but You can save images in your application documents folder. You can find more details at:
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/StandardBehaviors/StandardBehaviors.html#//apple_ref/doc/uid/TP40007072-CH4-SW6
You can also use NSFileManager to copy files.
what I suggest to do is :
put default images on project resources.
At first start, copy files to documents folder.
always use images from documents folder.