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

Featured Member Applications

TanZen ($0.99)

Endless Walls ($0.99)

Air Hockey ($0.99)

SUPER STRIKE - Motion Bowl ($0.99)

BarSlot ($0.99)

MeterRead ($0.99)

Colorblind Helper ($4.99)

gContacts ($1.99)

ProgCalc ($1.99)

Forex On The Go Lite (FREE)

HUE knewit! ($0.99)

Want your application to be advertised here?

» Advertisements


Visit our friends over at The App Show! Steve and Dave produce a weekly show shining a light on the iPhone 2.0 software and the applications being developed by the amazing development community for the iPhone SDK!
» Online Users: 98
14 members and 84 guests
detz, EeKay, freshking, hyang, jeff_lamarche, lymeric, Meltor, milkaxor, Moose, NewiPhoneDeveloper, rbmac, rockut111, rplasman
Most users ever online was 207, 10-24-2008 at 09:29 AM.
» Stats
Members: 3,915
Threads: 5,622
Posts: 23,276
Top Poster: scottiphone (705)
Welcome to our newest member, raysms
Reply
 
LinkBack Thread Tools Display Modes
Old 10-10-2008, 09:52 PM   #1 (permalink)
Senior Member
 
Join Date: Sep 2008
Posts: 210
Default Weird Animation issue...

Ok so I had an animation that was working great on an infinite loop.

Code:
- (void)cloudAnimation
{
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationRepeatCount:1e100f];
	[UIView setAnimationDuration:30.0];
	[UIView setAnimationDelegate:self];
	[UIView setAnimationRepeatAutoreverses:YES];
	cloudView.center = CGPointMake (20, 300);
	[UIView commitAnimations];
}
It was called in my "initWithFram" like this

Code:
		[self cloudAnimation];
Well this was working perfect while the view that was my main (and only) view was what loaded first but I switched to have multiple views and this view is no longer the first view loaded by my LevelViewControler.

I Flip into the view with the animation like this:

Code:
UIImage *startButtonImage = [UIImage imageNamed:@"startButtonA.png"];
	CGRect buttonFrame = CGRectMake(startShiftRightA, startShiftDownA, startButtonImage.size.width, startButtonImage.size.height);
	startButton = [self buttonWithTitle:nil target:self.viewControllerB selector:@selector(flipGame:) frame:buttonFrame image:startButtonImage];
Well the animation does not run anymore..

But I tried to attach that animation to another of my UIviews and it instantly moved that UIview to where the end of the animation would be without actually animating (it would load in with the view already at the ending point of the animation)

What's up with this? this animation is on an infinite loop.. it should just run once called.

I'm confused as to why it's broken now when it was working before.

as a note: the rest of my animations are still working..

I know it's because I added more views and this got screwy.. I think my view is not getting initialized correctly.

HELP!

Last edited by Kenrik; 10-11-2008 at 11:18 AM.
Kenrik is offline   Reply With Quote
Old 10-11-2008, 11:16 AM   #2 (permalink)
Senior Member
 
Join Date: Sep 2008
Posts: 210
Default

bumpity bump bump..
Kenrik is offline   Reply With Quote
Old 10-11-2008, 08:38 PM   #3 (permalink)
Senior Member
 
Join Date: Sep 2008
Posts: 210
Default

Ok well I figured out the "why" but I still don't know about the "how" to fix it.

MY project started with Apples "Bubble Level" sample and has grown into something much larger with custom classes and views.

Well the bubbleLevel has a XIB file that's setup for my games "levelView" and when I have the levelView as the first view that's loaded in my viewController everything works just fine.

if however I have my startScreen view set as my first view in my ViewController class and then flip over to the levelView the animations are broken. (I want the startScreen to be my initial view)

I think this is because the XIB is only setup for the levelView and not my new custom views.

I have not used IB at all in my project and really don't know how to use it (I like sticking with code only)

can someone please help me get the kinks out of this problem?
Kenrik is offline   Reply With Quote
Old 10-16-2008, 12:51 PM   #4 (permalink)
Member
 
Join Date: Aug 2008
Posts: 97
Default

sometimes I find this helps:
Code:
[self performSelectorOnMainThread:@selector(cloudAnimation) ... ];
smithdale87 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
Forum Jump

Powered by vBadvanced CMPS v3.0.1

All times are GMT -5. The time now is 05:25 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0