上传图片至Picasa与iPhone目标C

上传图片至Picasa与iPhone目标C

本文介绍了上传图片至Picasa与iPhone目标C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我想知道如果任何人有,他们已经习惯了图像上传到Picasa code的任何信息。我真的只需要code上传图片,我的一切努力让图像饲料和查看,但走另一条路是给我的一个问题。

I was wondering if anyone had any information of code that they have used to upload an image to Picasa. I really only need the code to upload images, I have everything working to get the image feed and view it, but going the other way is giving me a problem.

谷歌并没有真正提供如何做到这一点任何好的文档。任何帮助将大大AP preciated,先谢谢了!

Google does not really provide any good documentation for how to do this. Any help would be greatly appreciated, thanks in advance!

推荐答案

勾选此code:

GDataServiceGooglePicasaWeb* service =
 [[GDataServiceGooglePicasaWeb alloc] init];

[service setUserCredentialsWithUsername:@"[email protected]"
 password:@"mypasswd"];

// get the URL for the album
NSURL *albumURL = [GDataServiceGooglePicasaWeb
 picasaWebFeedURLForUserID:@"my.account" albumID:nil
 albumName:@"MyBestPhotos" photoID:nil kind:nil access:nil];

// set a title and description for the new photo
GDataTextConstruct *title, *desc;
title = [GDataTextConstruct textConstructWithString:@"Sunset Photo"];
desc = [GDataTextConstruct textConstructWithString:@"A nice day"];

GDataEntryPhoto *newPhoto = [GDataEntryPhoto photoEntry];
[newPhoto setTitle:title];
[newPhoto setPhotoDescription:desc];

// attach the photo data
NSData *data = [NSData dataWithContentsOfFile:@"/SunsetPhoto.jpg"];
[newPhoto setPhotoData:data];
[newPhoto setPhotoMIMEType:@"image/jpeg"];

// now upload it
GDataServiceTicket *ticket;
ticket = [service fetchPicasaWebEntryByInsertingEntry:newPhoto
 forFeedURL:albumURL
 delegate:self
 didFinishSelector:@selector(addPhotoTicket:finishedWithEntry:)
 didFailSelector:@selector(addPhotoTicket:failedWithError:)];

来源:的

这篇关于上传图片至Picasa与iPhone目标C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 18:10