我已经使用波纹管代码在电子表格(基于列表的提要)中添加行,但它不起作用......

NSMutableArray * array = [[NSMutableArray alloc] init];
GDataEntrySpreadsheetList *listEntry = [GDataEntrySpreadsheetList listEntry];
GDataSpreadsheetCustomElement *serialNo = [GDataSpreadsheetCustomElement elementWithName:@"SNo" stringValue:@"1"];
[array addObject:serialNo];
[listEntry setCustomElements:array];
//then after finding the worksheet
GDataServiceGoogleSpreadsheet *service = [self spreadsheetService];
NSURL *feedURL = [addedWorkSheet listFeedURL];
[service fetchEntryByInsertingEntry:listEntry
         forFeedURL:feedURL
             delegate:self
                  didFinishSelector:@selector(addEntry:finishedWithFeed:error:)];

上面的代码给出了如下错误:

error::-Error Domain=com.google.HTTPStatus Code=400 “操作无法完成。(很抱歉,发生服务器错误。请稍等,然后尝试重新加载您的电子表格。)” UserInfo=0x5fe2de0 {NSLocalizedFailureReason=(很抱歉,发生服务器错误。请稍等,然后尝试重新加载电子表格。), error=很抱歉,发生服务器错误。请稍等,然后尝试重新加载您的电子表格。}

请帮我解决这个错误。

提前致谢。

最佳答案

如果您尝试插入的 GDataEntrySpreadsheetList 不包含与工作表相关的 GDataSpreadsheetCustomElements,则可能会发生这种非常具有误导性的错误。

创建 GDataSpreadsheetCustomElement 时,您用于“名称”的字符串必须与您感兴趣的列的电子表格第一行中的值相匹配,除了 必须将其全部转换为小写并删除所有空格.

尝试用 elementWithName:@"sno"替换 elementWithName:@"SNo"

关于iphone - 在电子表格中添加行(基于列表的提要)但它不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7816634/

10-12 00:27
查看更多