我不知道我的回答是否正确(或)错误,但我尝试过这样......
感谢Iphone_bharat ,我从这里得到了一些代码
-(void)change
{
if (i>=imags.count-1)
i=0;
else
i++;
}
-(void)images
{
NSArray *imagenames = @[@"1.png",@"b.png",@"c.png"];
int j;
NSMutableArray *images= [[NSMutableArray alloc]init];
for (j=0; j<imagenames.count; j++)
[images addObject:[UIImage imageNamed:[imagenames objectAtIndex:j]]];
self.imageview1.animationImages = images;
self.imageview1.animationDuration =1;
[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(change) userInfo:nil repeats:YES];
[self.bground startAnimating];
}
-(IBAction)captureImage:(id)sender
{
self.imageview2.image = [images objectAtIndex:i];
CGRect rect = [self.view bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.view.layer renderInContext:context];
UIImage *capturedScreen = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(capturedScreen, nil, nil, nil);
}