【发布时间】:2023-03-14 19:48:01
【问题描述】:
我有以下代码:
+ (NSMutableArray*)getTodayData:(NSDate*)today
{
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/ichrono/20110715/60b88126/load_dr_daily_schedule/%@/", [self getDrChronoHost], [dateFormat stringFromDate:today]]];
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
[self addCurrentUserLoginToPostRequest:request];
[request setPostValue:[dateFormat stringFromDate:today] forKey:@"target_date"];
[request setDownloadCache:[ASIDownloadCache sharedCache]];
[request startSynchronous];
NSError *error = [request error];
NSString *responseString;
if (!error) {
responseString = [request responseString];
} else {
return NULL;
}
return [responseString JSONValue];
}
}
在我添加[request setDownloadCache:[ASIDownloadCache sharedCache]]; 之前它运行良好。
我如何得到错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ASIFormDataRequest setDownloadCache:]: unrecognized selector sent to instance 0x9a0140'
【问题讨论】:
标签: iphone objective-c cocoa-touch asihttprequest