views:

26

answers:

2

Hi all !

I've made a ViewBased app, in the app delegate i've set a UITabBarCotntroller, in the app i have different view Controller two of them displays text in a UITextView and labels, the other one is my "ShakeController" a UIViewController in which i've set a UIAcelerometerDelegate, in it i create a instance of UIAccelerometer, in the method which manages the shake everything works fine, in this controller i have also set a UIImageView to make a simple animation, in the view Did Load method i set my imageView.animation to an array of UIImage.

My problem is : when the app is launched i use the ViewControllers and everything work fine, but when i tap the ShakeController item in the tab bar and then when i come back to the other controllers the label looks like : label and textView like : Lorem ipsum..... the text of UItextView in IB.

I have noticed thaht if i comment the initialisation of my imageView to the array of image i can navigate the items (from a view controller to another) without the label change and stay what i want them to be.

Notice that the two controllers are in a UINavigationController.

(i use @proprety (nonnatomic, retain) then @synthesize ... then releqse in the dealloc for the labels textview and my uiimageView)

Do not know what to do thanks to all

A: 

Quite hard to understand what you're asking here... I re-read it three times and I'm still not sure!

Since you find the problem (the data in the other view being "released") goes away when you comment out your imageView animation initialisation, I would conclude that you are using up a large amount of the iPhone's memory which means that it is automatically unloading any un-seen view controllers. It will do this quite quickly to preserve memory.

You don't say how many images are in your animation, but just 10 medium-large images can be enough to trigger memory issues; if you are wanting to use 20/30+ you have to look for another way.

You can try just loading a few frames into your image first and then swapping them out on a recurring timer. But if it's anything more than very basic animation you'll need to get stuck in to core animation instead: http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/WhatisCoreAnimation.html#//apple_ref/doc/uid/TP40004689

h4xxr
A: 

Perfect thanks

Sorry but really hard to explain my animation is made of 16 images and in thé other controller i use an array of 1100 object (string from plist)

So it is too much for thé iPhone ???

When i say comment i meant delete.

Floo
because it only happens when i first tap the tab bar item of the Shake Controller, for expample i launch my app i use the First Controllers, then i tap the shake Controller item when i come back to my first item the label has changed but when i come back to the shake controller again, commit animation load data and all the stuff if i come back to the first controller the label does not change (sorry for being so obscur)
Flodev03
How much the iphone or ipod touch have memory ? ? is there a tool to see if it is too much memory for the iphone ? ? ? thanksssss
Flodev03