Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-02-2011, 01:36 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2011
Posts: 44
XaKaX is on a distinguished road
Default Several Animations

People, when I click in a button, several (5) animations in diferents parts of the view starts showing.

So, I have the folowing code:
Code:
       UIImageView *explosion;
        float delay;

        for (int i=0; i<5;i++) { 
            delay = 2.2;
           
            explosion = [[UIImageView alloc] init];
            
            if (i==0) {
                [explosion setFrame:CGRectMake( 115.0f, 50.0f, 100.0f, 200.0f)];
            }
            else if (i==1) {
                [explosion setFrame:CGRectMake( 30.0f, 100.0f, 75.0f, 191.0f)];
            }
            else if (i==2){
                [explosion setFrame:CGRectMake( 240.0f, 100.0f, 75.0f, 191.0f)];
            }
            else if (i==3){
                [explosion setFrame:CGRectMake( 0.0f, 109.0f, 240.0f, 300.0f)];
                delay = 2.8;
            }
            else if (i==4) {
                [explosion setFrame:CGRectMake( 90.0f, 109.0f, 240.0f, 300.0f)];
                delay = 2.8;
            }

            explosion.animationDuration = delay; 
            explosion.animationRepeatCount = 1;

            explosion.animationImages = [arrayOfArrays objectAtIndex:i]; 
            
            [self.view addSubview:explosion];
            [explosion startAnimating];
            
            [self performSelector: @selector(hideAnimation:)
                       withObject:explosion 
                       afterDelay:delay];
          
            [explosion release];
            
        }
arrayOfArrays, is an Array, witch have the Array of images of all the animations. So it is an array of arrays (ex.: in the position 1 have an array of all the images of the first animation, in the position 2 the same, but of the second animation).

It works fine on the simulator.
When I tested it on my iPod, it has a delay (like a lag), and when the 5 animation appears, it is alredy by the end..
But when I click on the button again (the second time), it works fine!


After that, everything runs normally (I can click as many time as I want on the button, that it will show me the 5 animations at the same time normaly, just like on the simulator).

What can I do? What is happening? And why only on the iPod?

Thanks!
XaKaX is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 401
16 members and 385 guests
7twenty7, AppsBlogger, Clouds, David-T, dedeys78, Duncan C, e2applets, EvilElf, HemiMG, heshiming, iekei, LunarMoon, Murphy, sacha1996, Sami Gh, teebee74
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,914
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0