1
是否可以將文檔從我的Gmail帳戶下載到iphone應用程序的文檔文件夾中。其實我使用Google Doc API並通過使用如何使用GoogleDocAPI將文檔下載到Iphone
-(GDataServiceGoogleDocs *)getdocservice
{
static GDataServiceGoogleDocs *docs = nil;
if(!docs)
{
docs = [[GDataServiceGoogleDocs alloc]init];
[docs setShouldCacheResponseData:YES];
[docs setServiceShouldFollowNextLinks:YES];
[docs setIsServiceRetryEnabled:YES];
[docs setUserCredentialsWithUsername:@"[email protected]" password:@"password"];
}
return docs;
}
//@@@@@@@@@@@@@@
GDataServiceTicket *ticket;
#pragma mark docService
docsService = [self getdocservice];
NSURL *feedURL = [GDataServiceGoogleDocs docsFeedURL];
GDataQueryDocs *queryDocs = [GDataQueryDocs documentQueryWithFeedURL:feedURL];
[queryDocs setMaxResults:1000];
[queryDocs setShouldShowFolders:YES];
ticket = [docsService fetchFeedWithQuery:queryDocs delegate:self didFinishSelector:@selector(docsFetchTicket:finishedWithFeed:error:)];
// call back
-(void)docsFetchTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedDocList *)feed error:(NSError *)error
{
GDataFeedDocList *mDocListFeed = feed;
int numDocs = [[feed entries] count];
NSLog(@"NumDocs :%d\n Feed :%@",numDocs,mDocListFeed);
for (int i=0; i<numDocs; i++) {
GDataEntryDocBase *docEntry = [mDocListFeed entryAtIndex:i];
NSLog(@"\[email protected]@@@@@@@@@@@ DocTitle :%@\n\n",[[docEntry content] sourceURL]);
}
}
它顯示我的帳戶中的所有文檔。 但我沒有得到如何將這些文件下載到我的應用程序文檔文件夾。如果有人有想法,請幫助我。