Add row to table (list-based feed), but it doesn't work

I used the following code to add a row to the table (list-based feed), but it does not work ...

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 an error, for example:

error :: - Error Domain = com.google.HTTPStatus Code = 400 "The operation could not be completed. (Sorry, a server error occurred. Wait a bit and try restarting the spreadsheet.)" UserInfo = 0x5fe2de0 {NSLocalizedFailureReason = (Sorry, an error occurred server. Wait a bit and try restarting the spreadsheet.), Error = Sorry, a server error has occurred. Wait a moment and try reloading the table.}

Please help me resolve this error.

Thanks in advance.

+4
source share
1 answer

This very erroneous error can occur if the GDataEntrySpreadsheetList that you are trying to insert does not contain the GDataSpreadsheetCustomElements that are related to the sheet.

When creating a GDataSpreadsheetCustomElement, the row you use for "name" must match the value in the first row of the table for the column of interest, EXCLUDE that it must be converted to all lower case and all spaces removed.

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

+1
source

All Articles