Naughty Tom Cat

Naughty Tom Cat

Source code introduction: The cute Tom cat can perform funny actions such as eating breakfast and yawning.

Source code effect:

Source code snippet:

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

Download address: http://download..com/data/2111751

<<:  High imitation Baidu Nuomi

>>:  Baidu's multiple apps have vulnerabilities, Wuyun claims it can remotely control Android devices

Recommend

Arrow points to manned lunar landing! Long March 10 is on schedule

The manned space station project has fully entere...

12 ultimate technical conjectures about the world of programming

It is still difficult to predict the future of th...

Introduction to Huawei AppGallery Paid Display Service

Paid display service introduction HUAWEI PPS (Pai...

If you have polyps, how far are you from cancer?

Expert of this article: Hu Zhongdong, chief physi...

Everything about Bitcoin in 2014 is in this report

Overall, 2014 can be described as a “Tale of Two ...

When optimizing to scale to multiple cores…

When optimizing to scale to multiple cores "...

Value 50: Find the 50 most valuable stocks in China

Value 50: Find the 50 most valuable stocks in Chi...

Do you know about the top 10 most popular fission marketing?

The article breaks down the top ten most popular ...

Douyin live streaming: Ten rules for traffic

Ten military rules for traffic ecology: 1. Douyin...

Analysis of iReader vs. WeChat Reading Products

Books are the ladder of human progress, but paper...