首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ASIFormDataRequest错误

ASIFormDataRequest错误
EN

Stack Overflow用户
提问于 2010-09-16 08:55:50
回答 1查看 1.1K关注 0票数 0
代码语言:javascript
复制
- (void) recordTransaction: (SKPaymentTransaction *) transaction {
    NSDictionary * receipt = [transaction.transactionReceipt dictionaryFromAppleResponse];
    NSDictionary * purchaseInfo = [[NSData dataFromBase64String: [receipt objectForKey: @"purchase-info"]] dictionaryFromAppleResponse];

    NSURL * url = [NSURL URLWithString: @"http://..."];

    ASIFormDataRequest * request = [ASIFormDataRequest requestWithURL: url];
    [request setDelegate: self];

    [request setPostValue: [NSNumber numberWithBool: YES] forKey: @"upload"];
    [request setPostValue: [[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleDisplayName"] forKey: @"app_id"];
    [request setPostValue: [receipt descriptionInStringsFileFormat] forKey: @"receipt"];
    [request setPostValue: [purchaseInfo descriptionInStringsFileFormat] forKey: @"purchase_info"];

    [WTFeedbackView switchToProgressView];
    [request setUploadProgressDelegate: [WTFeedbackView class]];

    NSLog(@"Before -startAsynchronous call.");
    [request startAsynchronous];
    NSLog(@"After  -startAsynchronous call.");
}

NSData -dictionaryFromAppleResponse返回NSDictionary。我不知道为什么会出现以下错误:

代码语言:javascript
复制
Error Domain=ASIHTTPRequestErrorDomain Code=10 "NSInvalidArgumentException" UserInfo=0x19eb00 {NSLocalizedFailureReason=+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil, NSUnderlyingError=0x19eae0 "The operation couldn’t be completed. (ASIHTTPRequestErrorDomain error 10.)", NSLocalizedDescription=NSInvalidArgumentException}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-09-16 09:15:54

如果您在objc_exception_throw上添加了断点,这将帮助您获得更多关于错误位置的信息(如果您这样做了,请务必将回溯添加到您的问题中)。

假设错误来自ASIHTTPRequest本身,它使用NSInvocation与它的委托对话。我对您的代码中的这一行表示怀疑:

代码语言:javascript
复制
[request setUploadProgressDelegate: [WTFeedbackView class]];

我不确定您是否可以将进度委托设置为一个类,我一直认为它必须是一个实际的对象-也许可以尝试删除它,我怀疑它会使错误消失。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3722988

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档