ios - AFXMLRequestOperation 与 Google 文档

标签 ios objective-c google-docs-api

我尝试了几种不同的方法来使用 AFNetworking 从 Google 文档中提取内容。

  1. 我修改了可接受的内容类型。
  2. 使用过 AFKiss 功能
  3. 使用常规 AFHttp 操作

仍然无法从下面的代码中获取任何内容。如果有人有一些想法,应该可以重现。

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://spreadsheets.google.com/feeds/worksheets/0AhNgJb3GRiT3dEFkYmJVQ1pUUXBpdWlOYjFBMUtpOEE/private/full"]];

AFXMLRequestOperation *operation = [AFXMLRequestOperation XMLParserRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, NSXMLParser *XMLParser) {
    NSLog(@"Finished");
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, NSXMLParser *XMLParse) {
    NSLog(@"Failed");
}];
[operation start];

最佳答案

在浏览器中查看该链接,无需登录 Google 帐户。它没有任何内容,因此无论您如何尝试都无法加载 xml。

您需要在您的应用中添加 Google 身份验证才能查看看起来的电子表格。信息可以在 Authenticating Users in Mobile Apps 找到指南。

关于ios - AFXMLRequestOperation 与 Google 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15855443/

相关文章:

ios - 在启动时显示模式登录 - 通过 UITableView

objective-c - "return @[blah, blah] [self.foo]"是什么意思?

html - 格式化 HTML 表格以粘贴到 Google 文档中

ios - 为什么 Google map 不能拉伸(stretch)以适应我的 UIView?

google-docs - Google Docs API - 更新链接表格

Python GAE 上传到 Google Docs

iphone - 如何在 UILabel 中将三次幂/立方体字符的上标显示为字符串?

ios - 强制应用程序在进入后台时始终采用相同的形式

ios - 如何在我的游戏中使用 iTunes 预览?

ios - 如何使用 PresentViewController 在 Storyboard中引用 ViewController