【发布时间】:2011-08-17 22:48:29
【问题描述】:
我正在尝试使用 GData Objective-C 客户端将一批单元格添加到 Google 电子表格中,如下所述:http://code.google.com/p/gdata-objectivec-client/wiki/GDataObjCIntroduction#Batch_requests。
这里是感兴趣的代码:
GDataFeedSpreadsheetCell *batchFeed = [GDataFeedSpreadsheetCell spreadsheetCellFeed];
NSURL *batchUrl = [[batchFeed batchLink] URL];
NSMutableArray *cells = [NSMutableArray array];
GDataSpreadsheetCell *cell = [GDataSpreadsheetCell cellWithRow:1 column:1 inputString:@"test" numericValue:nil resultString:nil];
GDataEntrySpreadsheetCell *cellEntry = [GDataEntrySpreadsheetCell spreadsheetCellEntryWithCell:cell];
[cells addObject:cellEntry];
[batchFeed setEntries:cells];
GDataBatchOperation *op;
op = [GDataBatchOperation batchOperationWithType:kGDataBatchOperationInsert];
[batchFeed setBatchOperation:op];
[service fetchFeedWithBatchFeed:batchFeed forBatchFeedURL:batchUrl completionHandler:nil];
它不起作用。显然,fetchFeedWithBatchFeed 没有对我的 GDataWorksheetEntry 对象的引用——所以它不起作用并不让我感到惊讶。
我遗漏了什么?
提前致谢。
【问题讨论】:
-
正如我所提到的,我认为问题在于我没有提供对我的 GDataEntryWorksheet 对象的引用。我怀疑批处理提要以某种方式必须从该对象派生,但我没有看到从我的工作表条目对象提供单元格提要的方法。
标签: objective-c gdata-api gdata