views:

32

answers:

1

Hi All,

I want to use a page in our xib which is change every month,This page contain text,song,and image.

Please tell me how i perform this,I think i put my song,image,and text file on the server and change every month song,image and text on the server which is automatically changed in our application.

If i am right then suggest me how i perform this, If not then please tell me how i add this functionality in our application.

Thanks,

Arun

A: 

Keep local copies of your text, music and images, so you don't have to retrieve them from the server every time you use your app and also have something to show when you don't have Internet connectivity. Pull the current month's data from the server if the app doesn't already have it, in the background, so the user doesn't have to wait for it to be downloaded before using your app and then transition to the new theme once you've downloaded the necessary files.

As for the implementation, use NSURLConnection and write your data to a local file:

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    filename = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:save_name];
    NSFileHandle *file1 = [NSFileHandle fileHandleForUpdatingAtPath: filename];
    [file1 writeData: data];
    [file1 closeFile];
}

For extra details, check out this example.

luvieere
If we put all items local then how i change it monthly
Arun Sharma
Thanks for your answer..........
Arun Sharma
You rewrite the local copies, monthly.
luvieere
Then it means my app Uploaded monthly basis again and again
Arun Sharma
Mmm.. no, it doesn't mean that. It does, however, mean that your app `downloads` data on a monthly basis again and again. By the local copies, I'm referring to your text, music and images, saved in the Documents folder and read by your app. Your app's executable doesn't change monthly, only the data you read from it.
luvieere