开发者

how to call an image in between for a particular period in objective-C

开发者 https://www.devze.com 2023-02-04 07:31 出处:网络
UIImageView *campFireView=[[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,480)]; //UIImageView *campFireView =[[UIImageView alloc] initWithFrame:campFireView];
       UIImageView *campFireView=[[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,480)];
       //UIImageView *campFireView =[[UIImageView alloc] initWithFrame:campFireView];

       // load all the frames of our animation
       campFireView.animationImages = [NSArray arrayWithObject:[UIImage imageNamed:@"Img_0.jpg"],
nil];
// all frames will execute in 1.75 seconds
       campFireView.animationDuration = 1.75;
       // repeat the annimation forever
       campFireView.animationRepeatCount = 1000.0;
       // start animating
       [campFireView startAnimating];

       // add the animation view to the main window 
       [self.vie开发者_C百科w addSubview:campFireView];

       [campFireView release];

the problem here is i want to set only one image so i have used arraywithobject but when i run this code it is giving me error that too many paramters for arrayWithObject. What is problem.Can anybody help me in solving this problem


arrayWithObject: takes only one parameter, so just remove the ,nil.

0

精彩评论

暂无评论...
验证码 换一张
取 消