Problem to accessing multiple photo from a specific grop

10 views
Skip to first unread message

Hafizur Rahman

unread,
Oct 12, 2009, 3:27:54 AM10/12/09
to objectiveflickr
I use these two method for accessing multiple photo from a specific
group one one or I want to show multiple photo on a same page. But it
frequently show only the First photo of this specified group. So how
can i get the total photo the this group??


- (IBAction)nextRandomPhotoAction:(id)sender
{
NSLog(@"Button Pressed");
if (![flickrRequest isRunning]) {
[flickrRequest
callAPIMethodWithGET:@"flickr.groups.pools.getPhotos"
arguments:[NSDictionary
dictionaryWithObjectsAndKeys:@"48834600@N00", @"group_id",
@"2",@"per_page", nil]];
}
}
//flickr.groups.pools.getPhotos
//flickr.photos.getRecent

- (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest
didCompleteWithResponse:(NSDictionary *)inResponseDictionary
{
NSLog(@"Complete");
NSDictionary *photoDict = [[inResponseDictionary
valueForKeyPath:@"photos.photo"] objectAtIndex:0];

NSString *title = [photoDict objectForKey:@"title"];
if (![title length]) {
title = @"No title";
}

//NSURL *photoSourcePage = [flickrContext
photoWebPageURLFromDictionary:photoDict];
//NSDictionary *linkAttr = [NSDictionary
dictionaryWithObjectsAndKeys:photoSourcePage, NSAttributeName, nil];
//NSMutableString *attrString = [[[NSMutableString alloc]
initWithString:title attributes:linkAttr] autorelease];
//[[textView textStorage] setAttributedString:attrString];

NSURL *photoURL = [flickrContext
photoSourceURLFromDictionary:photoDict size:OFFlickrSmallSquareSize];
NSString *htmlSource = [NSString stringWithFormat:
@"<html>"
@"<head>"
@" <style>body { margin: 0; padding: 0; } </style>"
@"</head>"
@"<body>"
@" <table border=\"0\" align=\"center\" valign=\"center\"
cellspacing=\"0\" cellpadding=\"0\" height=\"240\">"
@" <tr><td><img src=\"%@\" /></td></tr>"
@" </table>"
@"</body>"
@"</html>"
, photoURL];

[webView loadHTMLString:htmlSource baseURL:nil];
}


Thanks for quick reply. Then it may save our whole day.
Reply all
Reply to author
Forward
0 new messages