In one of my project, I want to use the TTURLRequestModel to populate the response data in XML format by passing the TTURLXMLResponse to the request. However, the delegate method is never called. Can someone tell me what I am missing in these two files? Do I need to initialize some other elements of the library?
Three20Parser.h
@interface Three20Parser : TTURLRequestModel{
}
- (void) download;
@end
Three20Parser.m
#import "Three20Parser.h"
#import "extThree20XML/extThree20XML.h"
@implementation Three20Parser
- (id)init{
self = [super init];
return self;
}
- (void) download{
NSString *requestURL = @"http://server.local/service.asmx";
NSLog(@"requestURL: %@", requestURL);
TTURLRequest *request = [TTURLRequest requestWithURL:requestURL delegate:self];
request.cacheExpirationAge = TT_CACHE_EXPIRATION_AGE_NEVER;
request.cachePolicy = TTURLRequestCachePolicyNone;
TTURLXMLResponse *response = [[TTURLXMLResponse alloc] init];
request.response = response;
TT_RELEASE_SAFELY(response);
[request send];
}
/*
the requestDidFinishLoad is not called.
*/
- (void)requestDidFinishLoad:(TTURLRequest *)request{
//TTURLXMLResponse *response = request.response;
//NSLog(@"response: %@", [[NSString alloc] initWithData:response.data encoding:NSUTF8StringEncoding]);
NSLog(@"REQUEST DID FINISH", nil);
}