I am trying to implement a simple TTURLRequest in my app. I'm pretty new to the Three20 framework. I mainly want TTURLRequest and TTImageView for the awesome caching stuff.
I have the following code in my delegate:
- (void)requestDidFinishLoad:(TTURLRequest*)request {
TTURLDataResponse *response = request.response;
// Stuff to process response.data
}
response is always nil. I can't figure out what I'm doing wrong. I looked in the Application Support directory and it's creating the cache file with the proper data, so I know it's getting a response. What am I doing wrong?
Debugged your code - you actually have to create a response object and add it to the request before sending your request:
NSString *url = @"http://twitter.com/statuses/user_timeline/samsoffes.json?count=1";
TTURLRequest *theRequest = [[TTURLRequest alloc] initWithURL:url delegate:self];
theRequest.response = [[[TTURLDataResponse alloc] init] autorelease];
[theRequest send];
One would think the request would be in charge of creating the response, but the Three20 stuff doesn't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With