Hey guys I've made an application that parses some xml, but I would like to try and improve the performance of it. So I am now trying to set up ASIDownloadCache from the ASIHTTPRequest library. I understand most of whats going on with it but I'm just not to sure on how to get it all up and running.
Here is what I have so far, I have been through the How-to file that is over at ASI but for this particular part of their library I have found that they are abit hard to understand (in regards to getting the code working). but they have explained all of the different options well.
My request method that sets up the data I will parse looks like this atm (still needs abit of work you can see in my comments I don't really know what to do with some of the class methods.. which I would like some help with)
any help would be hugely appreciated. If you need me to clarify my question some more please let me know.. the main objective here for me is to learn something new for my app hopefully to improve a few things.
Here is what I have so far, I have been through the How-to file that is over at ASI but for this particular part of their library I have found that they are abit hard to understand (in regards to getting the code working). but they have explained all of the different options well.
My request method that sets up the data I will parse looks like this atm (still needs abit of work you can see in my comments I don't really know what to do with some of the class methods.. which I would like some help with)
Code:
- (IBAction)setRequestString:(NSString *)string
{
//Set database address
NSMutableString *databaseURL = [[NSMutableString alloc] initWithString:@"http://***.***.***.***:8888/codeData/"]; // iphone development
//PHP file name is being set from the parent view
[databaseURL appendString:string];
//call ASIHTTP delegates (Used to connect to database)
NSURL *url = [NSURL URLWithString:databaseURL];
//Create If statments here
if (string == @"Mfg.xml") {
//Cache stuff goes in here
ASIDownloadCache *cache = [[ASIDownloadCache alloc] init];
[cache setStoragePath:@"what location do I put in here??? can I put this on the phone? how dose it work"];
[self setMyCache:cache]; //what is setMyCache?? I don't know whats going on here
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDownloadCache:[self myCache]]; //whats happening here?... I get abit lost after this.
[request setDownloadCache:[ASIDownloadCache sharedCache]];
[request setCachePolicy:ASIAskServerIfModifiedCachePolicy|ASIFallbackToCacheIfLoadFailsCachePolicy];
[request setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy];
[request setDelegate:self];
[request startAsynchronous];
}
else
{
//this else statment lets all of the other datasets work
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];
}
}
any help would be hugely appreciated. If you need me to clarify my question some more please let me know.. the main objective here for me is to learn something new for my app hopefully to improve a few things.