IOS_5 _ Tom, ios_5 Tom

Source: Internet
Author: User

IOS_5 _ Tom, ios_5 Tom

Finally:

BeyondViewController. h

//// BeyondViewController. h // 05_TomCat // Created by beyond on 14-7-23. // Copyright (c) 2014 com. beyond. all rights reserved. // # import <UIKit/UIKit. h> @ interface BeyondViewController: UIViewController @ property (weak, nonatomic) IBOutlet UIImageView * imgView_tom;-(IBAction) btnClick :( UIButton *) sender; @ end


BeyondViewController. m

//// BeyondViewController. m // 05_TomCat // Created by beyond on 14-7-23. // Copyright (c) 2014 com. beyond. all rights reserved. // # import "BeyondViewController. h "@ interface BeyondViewController () {NSDictionary * _ dict;} @ end @ implementation BeyondViewController-(void) viewDidLoad {[super viewDidLoad]; // sg_bundle template code, 1, get. MAIN package of the app; 2. Return the full fullPath of a file in the main package. NSBundle * mainBundle = [NSBundle mainBundle]; NSString * fullPath = [mainBundle pathForResource: @ "tom. plist "ofType: nil]; _ dict = [NSDictionary dictionaryWithContentsOfFile: fullPath];}-(IBAction) btnClick :( UIButton *) sender {// If the animation is in progress, if ([_ imgView_tom isAnimating]) {return ;}// the text above the button is the dictionary key, the value-1 indicates the number of animated images. // NSString * text = sender. titleLabel. text; NSString * text = [sender titleForState: UIControlStateNormal]; int * picNum = [_ dict [text] intValue]; NSLog (@ "% @ ---- % d", text, picNum); // call the custom method to play the animation [self playAnimatitonNamed: text picNumber: picNum];}-(void) playAnimatitonNamed :( NSString *) name picNumber :( int) picNum {// instantiate a variable array NSMutableArray * array = [NSMutableArray array]; // Add a UIImage for a variable array (int I = 0; I <picNum; I ++) {// method 1 for generating an image. The resident memory is overloaded. The NSString * fullName = [NSString stringWithFormat: @ "@@_%02d.jpg", name, I] is broken down. UIImage * img = [UIImage imageNamed: fullName]; // method 2 for generating an image. IO reads the full path and releases the image when it is used up, no memory resident // NSString * fullPath = [[NSBundle mainBundle] pathForResource: fullName ofType: nil]; // UIImage * img2 = [[UIImage alloc] initWithContentsOfFile: fullPath]; // Add the UIImage to the array [array addObject: img];} // set the UIImageView Animation Parameters and submit the animation _ imgView_tom.animationImages = array; _ imgView_tom.animationDuration = 0.1 * picNum; _ imgView_tom.animationRepeatCount = 1; [_ imgView_tom startAnimating];} @ end















The talking Tom Cat version 15 cannot be installed on the iphone.

IPHONG 3G? 3GS? 4?
Os3.x? OS4?

Tom concert for cats and mice

Tom sang the song "give way to busy people", excerpted from the opera "the hairdresser of Sevilla" and rosiny.

I saw it.
Reference: myself

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.