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 Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-22-2010, 11:40 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 46
NorthCode is on a distinguished road
Post Animation causing actual device to crash, while simulator runs fine.

Hi,

Im trying to run this animation code in my menu. It runs smoothly in the simulator, but crashes on an actual device with this note (Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")).

Heres my code, am I using too much memory?

Code:
.h


IBOutlet UIImageView *bakgrunn;


.m

bakgrunn.animationImages = [NSArray arrayWithObjects:    
									[UIImage imageNamed:@"snow1.png"],
								[UIImage imageNamed:@"snow2.png"],
								[UIImage imageNamed:@"snow3.png"],
								[UIImage imageNamed:@"snow4.png"],
								[UIImage imageNamed:@"snow5.png"],
								[UIImage imageNamed:@"snow6.png"],
								[UIImage imageNamed:@"snow7.png"],
								[UIImage imageNamed:@"snow8.png"],
								[UIImage imageNamed:@"snow9.png"],
								[UIImage imageNamed:@"snow10.png"],
								[UIImage imageNamed:@"snow11.png"],
								[UIImage imageNamed:@"snow12.png"],
								[UIImage imageNamed:@"snow13.png"],
								[UIImage imageNamed:@"snow14.png"],
								[UIImage imageNamed:@"snow15.png"],
								[UIImage imageNamed:@"snow16.png"],
								[UIImage imageNamed:@"snow17.png"],
								[UIImage imageNamed:@"snow18.png"],
								
				//THIS PART IS FILLED WITH THE REST, BUT I DONT WANT TO POST SO MUCH CODE				
								
								[UIImage imageNamed:@"snow86.png"],
								[UIImage imageNamed:@"snow87.png"],
								[UIImage imageNamed:@"snow88.png"],
								[UIImage imageNamed:@"snow89.png"],
								[UIImage imageNamed:@"snow90.png"],
								
									
									[UIImage imageNamed:@"snow91.png"], nil];
	
	
	
	
	// all frames will execute in 1.75 seconds
	bakgrunn.animationDuration = 4;
	// repeat the annimation forever
	bakgrunn.animationRepeatCount = 0;
	// start animating
	[bakgrunn startAnimating];
	 
	
	[self.view addSubview:bakgrunn];
	[self.view sendSubviewToBack:bakgrunn];
	
	[bakgrunn release];
NorthCode is offline   Reply With Quote
Old 11-22-2010, 09:27 PM   #2 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 107
JDave is on a distinguished road
Default

Without knowing the exact error, I am going ahead an saying you are running out of memory. I am guessing yoru animation will run if you animate correctly with 10 frames rather than the 90+ you have... either way, you will need to optimize you image frames and decrease the number of images... I have been able to get about 30 images (256 x 256 px opaqu PNGs at 16 colors) to cycle in about 5 seconds on a 3G iPhone, but it that is pushing the limit, but that's another story.

Simulator vs iPhone is not perfect, as the simulator does not "run out" of memory like the iPhone, and the CPU is faster. There are other differences, but these differences seem the most relevant in your case.

You can verify that you are out of memory by trapping logs in - -(void)didReceiveMemoryWarning in your view controller class...

Here is how to check the crash log on your device, to state the nature of the crash if the console did not :
1) in XCode, Windows -> Organizer
2) select your device from the left hand pane
3) Select the Device Logs tab on the right hand pane
4) Find you app in the list, and the title will "Low Memory" or "Crash" or something like that...
JDave is offline   Reply With Quote
Old 11-23-2010, 08:50 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 46
NorthCode is on a distinguished road
Thumbs up Thank you

That is a problem yes. I have really big resolution and many images. I will find a way to live without the animation.

Thank you.
NorthCode is offline   Reply With Quote
Old 11-24-2010, 02:07 PM   #4 (permalink)
Registered Member
 
Kilby's Avatar
 
Join Date: Nov 2009
Location: Baltimore, MD
Posts: 13
Kilby is on a distinguished road
Default

Quote:
Originally Posted by NorthCode View Post
That is a problem yes. I have really big resolution and many images. I will find a way to live without the animation.

Thank you.
I ran into this same issue on my last iPad app. I found that if I reduced the size of the frames in the middle by half that it helped tremendously. I had full screen iPad animation going, but I only used full resolution on the first and last frames... everything in the middle was half res, but you don't notice as much because it's only on screen for a split second. Just be sure to set your UIImageView to fill the space associated for it.

Also, as mentioned above, cut down on the number of frames in your animation. That will go a long way as well.
Kilby is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, imageview, iphone, uiimage

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: 412
11 members and 401 guests
7twenty7, ChrisYates, djohnson, gmarro, hussain1982, Kirkout, Retouchable, skrew88, SLIC, walex, xzoonxoom
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,128
Posts: 402,921
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

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