如何使用iOS上的Google Drive API处理电子表格

我正在尝试编写一个将其数据库存储在Google电子表格中的iPhone应用程序。 我遵循了DrEdit示例,该示例使用Drive API将纯文本文件读取/写入Google Drive。 我试图修改示例应用程序来处理电子表格。 我能够上传一个CSV文件,并要求Google将其转换。 不过,我真正想要的是直接使用mimeType:“application / vnd.google-apps.spreadsheet”。 我很新,如果有人能指点我一个例子,这将是非常有帮助的。 对于初学者,我想达到如下的东西

- (void)uploadSpreadSheetWithThreeCells { GTLUploadParameters *uploadParameters = nil; NSString *data = @"cell1,cell2,cell3"; NSData *spreadSheetContent = nil; /* How to initialize spreadSheetContent with data? */ [GTLUploadParameters uploadParametersWithData:spreadSheetContent MIMEType:@"application/vnd.google-apps.spreadsheet"]; GTLQueryDrive *query = [GTLQueryDrive queryForFilesInsertWithObject:self.driveFile uploadParameters:uploadParameters]; [self.driveService executeQuery:query completionHandler:nil]; } 

另外,Google Drive API是否正确? 最终,我希望能够更新电子表格的选定单元格,而不是上传整个文档。 我发现了一些其他选项,例如gdata api和电子表格api,但似乎Drive API是最新的,它应该包含另外两个的function?

提前致谢!

您应该使用Google Spreadsheets API直接操作电子表格的单元格:

https://developers.google.com/google-apps/spreadsheets/

Google Data APIs Objective-C客户端库支持Spreadsheet API,其中还包括一些可用作参考的示例:

http://code.google.com/p/gdata-objectivec-client/