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

User Operations: Are you sure you really understand user portraits?

When people perceive things, they always like to ...

Do flamingos get their red feathers from eating? Actually, humans can too!

I heard that many animals can eat themselves to c...

Apple fans must read: Review of Apple's top ten hot topics in 2017

This year has been a very busy year for Apple, wi...

Review the promotion and operation methods of the 618 event!

In this article, the author will take the 618 Mid...

Short video live streaming tips!

This time I will share with you some live broadca...

Besides looking good, what other uses do fluorescent organisms have?

Speaking of bioluminescent creatures, the first t...

How to get millions of traffic for free in 30 days?

Let me first tell you who this article is suitabl...

6 routines and 3 dimensions for B2B operators to attract new customers!

For 2B operators, attracting new customers means ...