Appoorva Faldu
Appoorva Faldu

Reputation: 444

Ios Application Caching the Webview & native calls

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.

Upvotes: 2

Views: 357

Answers (1)

Erhan
Erhan

Reputation: 906

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]];

Upvotes: 3

Related Questions