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 06-19-2010, 11:32 AM   #1 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default How to animate a lot of images?

Hi. I'm using the basic animationImages to animate a bunch of images. However, I'm animating 68 images all of them being the size of the entire screen. I'm using the iOS 4 GM version of xcode. When I load it on the simulator, it works just fine. However, when I load it on the device (which is running iOS 4 GM seed), it crashes and gives me this in the console:

Code:
Loading program into debugger…
Program loaded.
target remote-mobile /tmp/.XcodeGDBRemote-85984-26
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
continue
Program received signal:  “0”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")
(gdb)
I figured this was just a memory problem due to the fact I'm trying to animate 68 images, but can it be something else? If it is a memory problem, how can I go about animating these images without it crashing? Thanks for your help in advance.
Whitehk is offline   Reply With Quote
Old 06-19-2010, 11:36 AM   #2 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default

Quote:
Originally Posted by Whitehk View Post
Hi. I'm using the basic animationImages to animate a bunch of images. However, I'm animating 68 images all of them being the size of the entire screen. I'm using the iOS 4 GM version of xcode. When I load it on the simulator, it works just fine. However, when I load it on the device (which is running iOS 4 GM seed), it crashes and gives me this in the console:

Code:
Loading program into debugger…
Program loaded.
target remote-mobile /tmp/.XcodeGDBRemote-85984-26
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
continue
Program received signal:  “0”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")
(gdb)
I figured this was just a memory problem due to the fact I'm trying to animate 68 images, but can it be something else? If it is a memory problem, how can I go about animating these images without it crashing? Thanks for your help in advance.
UPDATE: I just tried loading on my iPod Touch dedicated to testing (also running iOS 4 GM seed) which has never had it loaded on it, and it worked just fine. However, when I try loading it on the iphone it crashes and gives me that error. Is this a bug? I've tried restarting xcode and deleting the app from the device and reinstalling it. Thanks for your help again.
Whitehk is offline   Reply With Quote
Old 06-19-2010, 12:22 PM   #3 (permalink)
ToM
InsiderApps.com
 
Join Date: Jul 2008
Posts: 101
ToM is on a distinguished road
Default

Just to be sure, maybe if you temporarily change the bundle identifier to see if that makes a difference when installing it.
ToM is offline   Reply With Quote
Old 06-19-2010, 12:26 PM   #4 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default

Quote:
Originally Posted by ToM View Post
Just to be sure, maybe if you temporarily change the bundle identifier to see if that makes a difference when installing it.
Thanks for the reply. I tried this, and it didn't work.
Whitehk is offline   Reply With Quote
Old 06-19-2010, 02:18 PM   #5 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Your images will take up almost 40 megabytes when uncompressed for display; that's too much memory for you to use. You can only use about 20MB on 1st and 2nd gen devices before you get memory warnings and crashes.

You should look at MPMoviePlayerController or MPMoviePlayerViewController instead of animationImages.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 06-19-2010, 05:59 PM   #6 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default

Quote:
Originally Posted by smasher View Post
Your images will take up almost 40 megabytes when uncompressed for display; that's too much memory for you to use. You can only use about 20MB on 1st and 2nd gen devices before you get memory warnings and crashes.

You should look at MPMoviePlayerController or MPMoviePlayerViewController instead of animationImages.
How come it'll work on my iTouch then? I don't understand. Doesn't the iTouch have the same amount of memory?
Whitehk is offline   Reply With Quote
Old 06-19-2010, 06:41 PM   #7 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Quote:
Originally Posted by Whitehk View Post
How come it'll work on my iTouch then? I don't understand. Doesn't the iTouch have the same amount of memory?
Which generation? The third gen has twice has much memory as the first and second gen touch or phone. Also, the touch in general has more memory available because it's not running the phone processes.

I've seen the same thing in testing. Trust me, it's a memory issue.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 06-19-2010, 06:45 PM   #8 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default

Quote:
Originally Posted by smasher View Post
Which generation? The third gen has twice has much memory as the first and second gen touch or phone. Also, the touch in general has more memory available because it's not running the phone processes.

I've seen the same thing in testing. Trust me, it's a memory issue.
It's the latest and greatest. The only problem is I want it to display images not play a movie. Is there any possible way I could do this without using too much memory?
Whitehk is offline   Reply With Quote
Old 06-19-2010, 08:27 PM   #9 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Quote:
Originally Posted by Whitehk View Post
It's the latest and greatest. The only problem is I want it to display images not play a movie. Is there any possible way I could do this without using too much memory?
Reduce the number or size of the images, or try using an NSTimer to load and display a new image instead of using animnationImages; then you don't need all of the images loaded at once, only the next few. You probably won't get a great framerate though.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 06-19-2010, 09:02 PM   #10 (permalink)
Registered Member
 
Whitehk's Avatar
 
Join Date: Feb 2010
Posts: 119
Whitehk is on a distinguished road
Default

Quote:
Originally Posted by smasher View Post
Reduce the number or size of the images, or try using an NSTimer to load and display a new image instead of using animnationImages; then you don't need all of the images loaded at once, only the next few. You probably won't get a great framerate though.
Ok. Thanks!
Whitehk is offline   Reply With Quote
Old 07-05-2010, 12:48 AM   #11 (permalink)
iou
Registered Member
 
Join Date: Jun 2010
Posts: 1
iou is on a distinguished road
Default I had some problem. My issue seems to be my iPhone 3G

I had the same issue just now and suspected it was iPhone was corrupted somehow. Some of my other apps that used to run fine and are now getting this error. After reading your post about how it works on your ipod, I went ahead and reinstall the firmware and it works fine afterward.

tldr: try firmware reinstallation if your codes working fine before.

good luck!


Quote:
Originally Posted by Whitehk View Post
UPDATE: I just tried loading on my iPod Touch dedicated to testing (also running iOS 4 GM seed) which has never had it loaded on it, and it worked just fine. However, when I try loading it on the iphone it crashes and gives me that error. Is this a bug? I've tried restarting xcode and deleting the app from the device and reinstalling it. Thanks for your help again.
iou is offline   Reply With Quote
Old 09-13-2010, 11:04 PM   #12 (permalink)
Registered Member
 
iMerlin's Avatar
 
Join Date: Aug 2010
Posts: 25
iMerlin is on a distinguished road
Default

Quote:
Originally Posted by smasher View Post
Your images will take up almost 40 megabytes when uncompressed for display; that's too much memory for you to use. You can only use about 20MB on 1st and 2nd gen devices before you get memory warnings and crashes.

You should look at MPMoviePlayerController or MPMoviePlayerViewController instead of animationImages.
Im running into the same error. Im fairly new to animations and also to iPhone development. I had a very large number of images in one of my animations (80). It ran fine in the Simulator but crashed on my 3Gs and my iP4. Based on your suggestion here, I went ahead and reduced my array to only a handful of images and it now runs on both. Thanks for pointing in the right direction, now I just have to figure out how to make these animation work.
iMerlin is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, data formatters, ios 4 gm, memory, memory leaks

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: 341
9 members and 332 guests
Absentia, anothermine, Chickenrig, Domele, givensur, heshiming, michaelhansen, PixelInteractive, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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