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

Detailed explanation of the core of Pinduoduo’s gamification operations!

The street stall economy suddenly became popular ...

9 methods for selecting topics for short video operations, super comprehensive!

In short video creation, topic selection means th...

Xu Kaiwen Psychoanalytic Psychotherapy Beginner-Intermediate

Introduction to Xu Kaiwen's psychoanalytic ps...

Huawei App Market search keyword promotion!

1. Introduction to search keyword promotion As on...

Traffic diversion and retention of Douyin private domain traffic pool

I have personally been focusing on the operation ...

Apple iOS 15 official version WeChat voice "press and hold to speak" has a delay

IT Home reported on October 12 that the official ...

20+ Useful AngularJS Tools Recommended for Web Developers

[[154690]] This article is translated from: 20+ U...

A timely help? NIO completes $100 million convertible bond financing

Recently, NIO announced that it has signed a conv...

How to operate a product in Jianshu

1. Product positioning Jianshu is a product that ...

IEA report: China’s roadmap for carbon neutrality in the energy sector

Over the past four decades, China’s remarkable ec...

Why do we Chinese prefer iPhone 6 plus?

One of the characteristics of the Internet is tha...