現在、以下のようなObjectiveCクライアントを使用してPicasaに写真をアップロードしようとしています。
GDataServiceGooglePhotos* service =
[self photoService];
// get the URL for the album
NSURL *albumURL = [GDataServiceGooglePhotos
photoFeedURLForUserID:userEmailAdress albumID:albumName
albumName:nil photoID:nil kind:@"album" access:@"all"];
// set a title and description for the new photo
NSDateFormatter *df = [[NSDateFormatter alloc] init];
df.dateFormat = @"yyyyMMddHHmmssSSSS";
GDataTextConstruct *title, *desc;
title = [GDataTextConstruct textConstructWithString:[df stringFromDate:[NSDate date]]];
desc = [GDataTextConstruct textConstructWithString:[descriptionTextfield text]];
GDataEntryPhoto *newPhoto = [GDataEntryPhoto photoEntry];
[newPhoto setTitle:title];
[newPhoto setPhotoDescription:desc];
// attach the photo data
NSData *data = UIImageJPEGRepresentation(imageView.image, 1.0);
[newPhoto setPhotoData:data];
[newPhoto setPhotoMIMEType:@"image/jpeg"];
[newPhoto setUploadData:data];
[newPhoto setUploadMIMEType:@"image/jpeg"];
[newPhoto setUploadSlug:title.stringValue];
// now upload it
GDataServiceTicket *ticket;
ticket = [service fetchEntryByInsertingEntry:newPhoto forFeedURL:albumURL delegate:self didFinishSelector:@selector(addPhotoTicket:finishedWithEntry:error:)];
[service setServiceUploadProgressSelector:nil];
そしてこれが私のaddPhotoTicket:finishedWithEntry:error:メソッドです
if (error == nil) {
NSLog(@"UPLOADED");
} else {
NSLog(@"THERE WAS AN ERROR");
}
「エラーが発生しました」というメッセージが表示され続け、failedWithStatus:400データ:写真データまたはソースIDを含める必要があります。どんな助けでも大歓迎です。
ありがとう。