I am making an app that lets users post to their Flickr photo streams. I am using ObjectiveFlickr to handle the authorization and posting process.
For posting a single picture i am using the following code:
if (isSinglePic) {
UIImage *img = self.singlePic;
NSData *JPEGData = UIImageJPEGRepresentation(img, 1.0);
self.flickrRequest.sessionInfo = __kUploadImageStep;
[self.flickrRequest uploadImageStream:[NSInputStream inputStreamWithData:JPEGData] suggestedFilename:self.descriptionTextField.text MIMEType:@"image/jpeg" arguments:[NSDictionary dictionaryWithObjectsAndKeys:@"0", @"is_public", nil]];
//[NSDictionary dictionaryWithObjectsAndKeys:photoID, @"photo_id", @"PicknPost", @"title", @"via PicknPost", @"description", nil]]
[UIApplication sharedApplication].idleTimerDisabled = YES;
}
This works just fine. However, when i try to post multiple pics that i stored in a NSMutableArray, ObjectiveFlickr uploads only the first picture.
My code for posting multiple photos looks like this:
NSMutableArray *array = [[NSMutableArray alloc] initWithArray:picsToPost copyItems:YES];
for (UIImage *imgToPost in array) {
NSData *JPEGData = UIImageJPEGRepresentation(imgToPost, 1.0);
self.flickrRequest.sessionInfo = __kUploadImageStep;
[self.flickrRequest uploadImageStream:[NSInputStream inputStreamWithData:JPEGData] suggestedFilename:self.descriptionTextField.text MIMEType:@"image/jpeg" arguments:[NSDictionary dictionaryWithObjectsAndKeys:@"0", @"is_public", nil]];
[UIApplication sharedApplication].idleTimerDisabled = YES;
Does anyone have an idea why the for-in statement doesn't work?
Any help would be appreciated.