GData Picasa相册iPhone

GData Picasa相册iPhone,iphone,objective-c,gdata-api,picasa,Iphone,Objective C,Gdata Api,Picasa,我希望有人能帮我解决这个问题。我正在尝试从iphone应用程序访问Picasa网络相册。我以前在Google Calendar中使用过GData,并获得了与之相关的事件和数据,因此我以类似的方式设置了我的方法。然而,我得到了一个错误,告诉我如下 serviceBase:<GDataServiceGooglePhotos: 0x4d4e6d0> objectFetcher:<GDataHTTPFetcher: 0xbaa35c0> failedWithStatus:400

我希望有人能帮我解决这个问题。我正在尝试从iphone应用程序访问Picasa网络相册。我以前在Google Calendar中使用过GData,并获得了与之相关的事件和数据,因此我以类似的方式设置了我的方法。然而,我得到了一个错误,告诉我如下

serviceBase:<GDataServiceGooglePhotos: 0x4d4e6d0> objectFetcher:<GDataHTTPFetcher: 0xbaa35c0> failedWithStatus:400 data:Too many results requested
然而,我无法克服这个问题。有没有人能提出解决这个问题的建议。我做错什么了吗

我检索图片的完整代码如下所示。picAlbum所说的任何地方,都是一个预定义的存储信息的NSArray

- (GDataServiceGooglePhotos *)photoService {

    static GDataServiceGooglePhotos* service = nil;
    if (!service) {
        service = [[GDataServiceGooglePhotos alloc] init];
        [service setShouldCacheDatedData:YES];
        [service setServiceShouldFollowNextLinks:YES];
    }

    [service setUserCredentialsWithUsername:@"username"
                                   password:@"password"];
    return service;
}


-(void)loadGooglePhotos {
    [self fetchAllPhotos];
}

-(void)fetchAllPhotos {
    NSLog(@"In fetchAllPhotos");
    GDataServiceGooglePhotos *service = [self photoService];
    GDataServiceTicket *ticket;

    ticket = [service fetchFeedWithURL:[NSURL URLWithString:kGDataGooglePhotosKindAlbum]
                              delegate:self
                     didFinishSelector:@selector(photosListTicket:finishedWithFeed:error:)];
}

- (void)photosListTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedPhotoAlbum *)feed error:(NSError *)error {

    NSLog(@"In photosListTicket");
    NSArray *photos = [feed entries];
    if ([photos count] != 0){
        self.picAlbum = [photos objectAtIndex:0];
        NSLog(@"fetching photos");
        [self fetchPhotos];
    }
    else {
        NSLog(@"User has no photos...");
    }
}

- (void)fetchPhotos {

    NSLog(@"In fetchPhotos");
    if (self.picAlbum) {
        NSURL *feedURL = [[self.picAlbum alternateLink] URL];
        if (feedURL) {
            NSLog(feedURL);
            GDataQueryGooglePhotos *query = [GDataQueryGooglePhotos photoQueryWithFeedURL:feedURL];
            [query setMaxResults:1000];
            GDataServiceGooglePhotos *service = [self photoService];
            GDataServiceTicket *ticket;
            ticket = [service fetchFeedWithQuery:query delegate:self didFinishSelector:@selector(photosEventsTicket:finishedWithFeed:error:)];
        }
    }
}

- (void)photosEventsTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedPhotoAlbum *)feed error:(NSError *)error {

    NSLog(@"In photosEventsTicket");
    NSArray *photos = [feed entries];
    NSLog([NSString stringWithFormat:@"%i",[photos count]]);
}
提前感谢您提供的任何信息或帮助

如果服务器说“请求的结果太多”,则表明max results查询参数太大


代码段中的回迁似乎不起作用。kGDataGooglePhotosKindAlbum和相册的alternateLink都不是订阅源的URL。

你对我可以用什么来代替有什么建议吗,因为我已经尝试过改变一切,但不是很幸运,我仍然能够从相册中获取照片内容和所有这些内容,但我确实通过了太多的请求解决了整个问题。事实证明,我使用的url正在访问Picasa上的所有提要。这就解释了结果太多的原因。我能做的是使用另一种方法来获取url,我在搜索NSURL*feedURL=[GdatServiceGooglePhotos photoFeedURLForUserID:@“username”albumID:nil albumName:@“album name”photoID:nil kind:nil access:nil]后找到了url;
- (GDataServiceGooglePhotos *)photoService {

    static GDataServiceGooglePhotos* service = nil;
    if (!service) {
        service = [[GDataServiceGooglePhotos alloc] init];
        [service setShouldCacheDatedData:YES];
        [service setServiceShouldFollowNextLinks:YES];
    }

    [service setUserCredentialsWithUsername:@"username"
                                   password:@"password"];
    return service;
}


-(void)loadGooglePhotos {
    [self fetchAllPhotos];
}

-(void)fetchAllPhotos {
    NSLog(@"In fetchAllPhotos");
    GDataServiceGooglePhotos *service = [self photoService];
    GDataServiceTicket *ticket;

    ticket = [service fetchFeedWithURL:[NSURL URLWithString:kGDataGooglePhotosKindAlbum]
                              delegate:self
                     didFinishSelector:@selector(photosListTicket:finishedWithFeed:error:)];
}

- (void)photosListTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedPhotoAlbum *)feed error:(NSError *)error {

    NSLog(@"In photosListTicket");
    NSArray *photos = [feed entries];
    if ([photos count] != 0){
        self.picAlbum = [photos objectAtIndex:0];
        NSLog(@"fetching photos");
        [self fetchPhotos];
    }
    else {
        NSLog(@"User has no photos...");
    }
}

- (void)fetchPhotos {

    NSLog(@"In fetchPhotos");
    if (self.picAlbum) {
        NSURL *feedURL = [[self.picAlbum alternateLink] URL];
        if (feedURL) {
            NSLog(feedURL);
            GDataQueryGooglePhotos *query = [GDataQueryGooglePhotos photoQueryWithFeedURL:feedURL];
            [query setMaxResults:1000];
            GDataServiceGooglePhotos *service = [self photoService];
            GDataServiceTicket *ticket;
            ticket = [service fetchFeedWithQuery:query delegate:self didFinishSelector:@selector(photosEventsTicket:finishedWithFeed:error:)];
        }
    }
}

- (void)photosEventsTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedPhotoAlbum *)feed error:(NSError *)error {

    NSLog(@"In photosEventsTicket");
    NSArray *photos = [feed entries];
    NSLog([NSString stringWithFormat:@"%i",[photos count]]);
}