在电子表格中添加行(基于列表的提要)但它不起作用

发布于 2024-12-10 19:37:30 字数 1001 浏览 0 评论 0原文

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

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=很抱歉,发生服务器错误。请稍等一下,然后尝试重新加载您的电子表格。}

请帮助我解决此错误。

提前致谢。

I have used the bellow code to add row in spreadsheet (List-based feed) but it not works ...

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:)];

The above code gives error like:

error::-Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (We're sorry, a server error occurred. Please wait a bit and try reloading your spreadsheet.)" UserInfo=0x5fe2de0 {NSLocalizedFailureReason=(We're sorry, a server error occurred. Please wait a bit and try reloading your spreadsheet.), error=We're sorry, a server error occurred. Please wait a bit and try reloading your spreadsheet.}

Please help me to solve this error.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青衫负雪 2024-12-17 19:37:30

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

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

尝试将 elementWithName:@"SNo" 替换为 elementWithName:@"sno"

This very misleading error can occur if the GDataEntrySpreadsheetList you're trying to insert contains no GDataSpreadsheetCustomElements that are relevant to the worksheet.

When creating a GDataSpreadsheetCustomElement, the string you use for "name" must match the value in the first row of the spreadsheet for the column you're interested in, EXCEPT that it must be converted to all lower-case and have all spaces removed.

Try replacing elementWithName:@"SNo" with elementWithName:@"sno"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文