淘气汤姆猫

移动开发
可爱的汤姆猫会实现,吃早餐,打哈欠等搞笑动作。

源码简介:可爱的汤姆猫会实现,吃早餐,打哈欠等搞笑动作。

源码效果:

源码片段:

  1. -(void)btnClick:(UIButton *)button 
  2.     if (button.tag==1) { 
  3.     NSMutableArray *arrM=[[NSMutableArray alloc] init]; 
  4.     for (NSInteger i=0; i<12; i++) { 
  5.     NSString *name=[NSString stringWithFormat:@"cat_cymbal00%02ld.jpg",i]; 
  6.     [arrM addObject:[UIImage imageNamed:name]]; 
  7.     } 
  8.           
  9.     imageView.animationImages=arrM; 
  10.     imageView.animationDuration=3.0
  11.     imageView.animationRepeatCount=1
  12.     [imageView startAnimating]; 
  13.           
  14.     [self performSelector:@selector(playSoundWithFileName:) withObject:@"cymbal" afterDelay:0.5]; 
  15.           
  16.     }else if (button.tag==2){ 
  17.         NSMutableArray *arrM=[[NSMutableArray alloc] init]; 
  18.         for (NSInteger i=0; i<27; i++) { 
  19.             NSString *name=[NSString stringWithFormat:@"cat_fart00%02ld.jpg",i]; 
  20.             [arrM addObject:[UIImage imageNamed:name]]; 
  21.         } 
  22.           
  23.         imageView.animationImages=arrM; 
  24.         imageView.animationDuration=5.0
  25.         imageView.animationRepeatCount=1
  26.         [imageView startAnimating]; 
  27.           
  28.         [self performSelector:@selector(playSoundWithFileName:) withObject:@"fart003_11025" afterDelay:0.6]; 
  29.     }else if (button.tag==3){ 
  30.         NSMutableArray *arrM=[[NSMutableArray alloc] init]; 
  31.         for (NSInteger i=0; i<39; i++) { 
  32.             NSString *name=[NSString stringWithFormat:@"cat_eat00%02ld.jpg",i]; 
  33.             [arrM addObject:[UIImage imageNamed:name]]; 
  34.         } 
  35.         imageView.animationImages=arrM; 
  36.         imageView.animationDuration=3.0
  37.         imageView.animationRepeatCount=1
  38.         [imageView startAnimating]; 
  39.         [self performSelector:@selector(playSoundWithFileName:) withObject:@"p_eat" afterDelay:0.5]; 

下载地址:http://down.51cto.com/data/2111751

责任编辑:倪明 来源: devstore
相关推荐

2015-07-16 13:45:18

山寨汤姆猫源码

2015-05-05 09:56:44

GMGC

2020-07-31 14:50:16

AWS云原生大数据

2015-03-25 10:59:55

javascriptjavascript编编程题题解

2014-08-20 10:14:14

程序员

2020-09-08 14:03:08

就业AI

2016-03-07 10:59:07

电子邮件

2022-07-25 09:56:49

AIDeepfake

2017-06-30 17:48:59

互联网

2016-07-07 13:30:06

短信猫

2018-01-24 15:25:46

天猫

2016-11-30 15:30:42

架构工具和方案

2010-04-19 17:17:42

无线猫上网设置

2010-04-06 22:42:32

无线ADSL猫

2009-12-09 14:34:58

2012-04-25 15:45:38

云平台

2017-12-26 17:20:46

撸猫

2020-02-14 15:50:16

云计算神扯

2009-02-09 16:49:22

点赞
收藏

51CTO技术栈公众号