我的改进代码.....我在 ViewController.m viewDidLoad() 中编写了以下代码。它已经调用了我的 loadAnimate 函数。
self.classAnimate = [[animateClass alloc] initWithFrame:CGRectMake(0, 340, 320, 80)];
[self.classAnimate loadAnimate];
[self.view addSubview:classAnimate];
但是当返回时无法加载到我的 addSubview。我不知道我在 animateClass 的 loadAnimate() 函数中做错了什么
-(void)loadAnimate
{
NSLog(@"Calling from ViewController file");
animationImages = [NSArray arrayWithObjects:[UIImage imageNamed:@"adv01.png"],
[UIImage imageNamed:@"adv02.png"],
[UIImage imageNamed:@"adv03.png"],nil];
campFireView.animationImages = [NSArray arrayWithArray:animationImages];
NSLog(@"Images inside animationImages are: %@",animationImages);
campFireView.animationDuration = 1.75;
campFireView.animationRepeatCount = 0;
[campFireView startAnimating];
}