Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)playAnimations:(NSString*)animationName:(int)photoCount
- {
- NSString *photoPathName;
- UIImage *object = [[UIImage alloc]init];
- for (int i=1; i<photoCount+1; i++)
- {
- NSString *imagesName=@"";
- if (i<10) {
- imagesName =[photoPathName stringByAppendingFormat:@"000%d",i];
- }
- else if(i>9 && i<100)
- imagesName =[photoPathName stringByAppendingFormat:@"00%d",i];
- else if(i>99 && i<1000)
- imagesName =[photoPathName stringByAppendingFormat:@"0%d",i];
- object = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:imagesName ofType:@"png"]];//[UIImage imageNamed:imagesName];
- [self.arrayImagesName addObject:object];
- }
- self.animationImage.animationImages = self.arrayImagesName;
- self.animationImage.animationDuration =durationTime ;// defaults is number of animation images * 1/30th of a second
- self.animationImage.animationRepeatCount = 1; // default is 0, which repeats indefinitely
- [self.animationImage startAnimating];
- }
- UIImage *object = [[UIImage alloc]init];
- for (int i=1; i<photoCount+1; i++)
- {
- // some code
- UIImage *object = [[UIImage alloc]initWithContentOfFile:[[NSBundle mainBundle] pathForResource:imagesName ofType:@"png"]];
- [self.arrayImagesName addObject:object];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement