ios - 使用自述文件中的示例时出现 AFNetworking 异常
<p><p>我还提交了一个问题 <a href="https://github.com/AFNetworking/AFNetworking/issues/1383" rel="noreferrer noopener nofollow">here</a> . </p>
<p>使用自述文件中的代码:</p>
<pre><code>AFHTTPRequestOperationManager *manager = ;
[manager GET:@"http://www.google.com" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
</code></pre>
<p>抛出以下异常:</p>
<pre><code>2013-09-27 22:16:10.345 Grades -: unrecognized selector sent to instance 0x1666c3f0
2013-09-27 22:16:10.349 Grades *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-: unrecognized selector sent to instance 0x1666c3f0'
*** First throw call stack:
(0x2ee83f53 0x396926af 0x2ee878e7 0x2ee861d3 0x2edd5598 0xe49ed 0xe4c4d 0x100b93 0x3160f3db 0x31723c57 0x3160f3db 0x316759e7 0x31675971 0x315ed48f 0x2ee4f1d5 0x2ee4cb79 0x2ee4cebb 0x2edb7ce7 0x2edb7acb 0x33ab2283 0x31659a41 0xf1075 0x39b9aab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
</code></pre>
<p>我已确认所有 AFNetworking 文件都已更新到 2.0。</p>
<p>如何解决此异常?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>问题是某些文件没有正确更新。尝试从项目目录中删除所有 AFNetworking 文件,清理并构建,安装新文件,然后再次清理并构建。</p></p>
<p style="font-size: 20px;">关于ios - 使用自述文件中的示例时出现 AFNetworking 异常,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/19070594/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/19070594/
</a>
</p>
页:
[1]