我想使用GData Objective-C客户端将一批单元格添加到Google Spreadsheet中,如下所述:http://code.google.com/p/gdata-objectivec-client/wiki/GDataObjCIntroduction#Batch_requests。使用gdata-objectivec-client无法正常工作批量插入电子表格单元格
这里是感兴趣的代码:
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对象的引用。我怀疑批处理源不得不从这个对象派生,但我没有看到从我的工作表入口对象提供单元提要的方式。 – Erik