so i got this scrollview gallery working and i want to be able to send the pictures by email, but it's only working for the image i setup ...how can i make it work for each of the images .... the code looks like this:
- (void)viewDidLoad
{
self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];
[scrollView setCanCancelContentTouches:NO];
scrollView.clipsToBounds = YES;
scrollView.scrollEnabled = YES;
scrollView.pagingEnabled = YES;
scrollView.showsHorizontalScrollIndicator = NO;
NSUInteger i;
for (i = 1; i <= kNumImages; i++)
{
NSString *imageName = [NSString stringWithFormat:@"item%d.png", i];
UIImage *image = [UIImage imageNamed:imageName];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
CGRect rect = imageView.frame;
rect.size.height = kScrollObjHeight;
rect.size.width = kScrollObjWidth;
imageView.frame = rect;
imageView.tag = i;
[scrollView addSubview:imageView];
[imageView release];
}
[self layoutScrollImages];
}
................
and the attachment code:
NSString *path = [[NSBundle mainBundle] pathForResource:@"item1" ofType:@"png"];
NSData *myData = [NSData dataWithContentsOfFile

ath];
[MailComposer addAttachmentData:myData mimeType:@"image/png" fileName:@"item1"];
so what I want is instead of using item1 to be able to use the image that is displayed at the moment...
any ideas?