2

Developing the Native App for ipad, Initial screen i have on 'ViewDidLoad' a webcall made to read a file on web getting me the results and showing the list.

Prob 1: when i change the content of file in Web it doesnt reflect in my app, even i kill app still result is old same. can anyone help me with this issue.

After this list select it lands to WebView.

Prob 2: When i change anything on server side javascript. it doesnt reflect on the Native App, it does still give me old response only. (i.e Javascript and Css changes are not reflect in App). Can anyone please help me throught this part.

IOS 7 native App in Ipad. If you need code i can post it.

4
  • When you change the content of the file, does the change reflects in the web page ? Commented Apr 3, 2014 at 6:48
  • @HimanshuJoshi - Yes It does reflect in web, and on web its file that i am reading to show list of options. So it works fine in Web but on Native side still give same old result Commented Apr 3, 2014 at 6:58
  • Did you try with @erhnby solution? Commented Apr 3, 2014 at 6:58
  • Yup worked for the WebView Part. But Native part still trying Commented Apr 3, 2014 at 7:11

1 Answer 1

3

You should specify a CachePolicy:

enum
{
    NSURLRequestUseProtocolCachePolicy = 0,

    NSURLRequestReloadIgnoringLocalCacheData = 1,
    NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4, // Unimplemented
    NSURLRequestReloadIgnoringCacheData = NSURLRequestReloadIgnoringLocalCacheData,

    NSURLRequestReturnCacheDataElseLoad = 2,
    NSURLRequestReturnCacheDataDontLoad = 3,

    NSURLRequestReloadRevalidatingCacheData = 5, // Unimplemented
};

typedef NSUInteger NSURLRequestCachePolicy;

Try this:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:myURLString] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:nil]];
Sign up to request clarification or add additional context in comments.

1 Comment

thanks, it worked well for the Prob 2. but Still i am trying for the Prob 1. in Native Side call. where can i embed the cache policy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.