Adding a new worksheet.

66 views
Skip to first unread message

Alfredo

unread,
Jan 9, 2011, 6:10:51 PM1/9/11
to Google Data APIs Objective-C Client Library Discussion
Hi Experts.

I'm trying to add a new worksheet to a spreadsheet already created but
I am new with this api and I have the following error.
I'm not sure if I do something worong, please any help, new ideas
comments, welcome.

Thanks a lot!!!

2011-01-09 23:58:03.135 Gastos[7072:207] -[NSCFString XMLElement]:
unrecognized selector sent to instance 0xef73c
2011-01-09 23:58:03.138 Gastos[7072:207] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString
XMLElement]: unrecognized selector sent to instance 0xef73c'


My code is

GDataEntryWorksheet *w;
w = [[GDataEntryWorksheet alloc] init];

w.title = [[NSString alloc] initWithString:@"Alfredo"];
w.rowCount = 20;
w.columnCount = 20;

NSURL *feedURL = [spreadsheet worksheetsFeedURL];
GDataServiceGoogleSpreadsheet *service = [self spreadsheetService];

[service fetchEntryByInsertingEntry:w
forFeedURL:feedURL
delegate:self

didFinishSelector:@selector(insertedTicket:finishedWithEntry:error:)];

Greg Robbins

unread,
Jan 9, 2011, 7:26:10 PM1/9/11
to gdata-objec...@googlegroups.com
The title of an entry is not a string, but rather a GDataTextConstruct. See GDataEntryBase.h for the common methods on entries.

There is a convenience method for setting a title with an NSString. Set the title of a new entry like this:

   [entry setTitleWithString:@"Alfredo"]


Also, use the class method

  [GDataEntryWorksheet worksheetEntry]

to make a new worksheet entry rather than call alloc/init on GDataEntryWorksheet.

Alfredo

unread,
Jan 10, 2011, 7:52:08 AM1/10/11
to Google Data APIs Objective-C Client Library Discussion
WoW!!! It works perfectly!!!

Thanks a lot!!!

jitender bhumiwal

unread,
Jul 29, 2012, 7:27:06 AM7/29/12
to gdata-objec...@googlegroups.com
Hi 

Please provide me the sample project for iPhone adding row in spreadsheet ..

Thanks in advance ..
Reply all
Reply to author
Forward
0 new messages