在电子表格中添加行(基于列表的提要)但它不起作用
我已使用以下代码在电子表格(基于列表的提要)中添加行,但它不起作用...
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您尝试插入的 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"