Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GDataServiceGooglePicasaWeb* service =
- [[GDataServiceGooglePicasaWeb alloc] init];
- [service setUserCredentialsWithUsername:@"my.account@gmail.com"
- 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:)];
Add Comment
Please, Sign In to add comment