Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

imaumac

macrumors member
Original poster
Oct 15, 2008
52
0
Hi, i just want to know if some one here can help me to free memory runing my app.

I am working books (app) with more than 45 UIViews jumping with buttons between UIViews.......and every UIView have a background 320x480 png picture.

here show 2 graphics how i am using:

code1.jpg



code2.jpg



then my 2 questions are:

first, what code i have to put to remove from super view and free more memory removing UIViews

and second: where i have to put that xcode.

some people give me this next code: but i dont know how use it, and where to use it.

myView = [[UIView alloc] init]

or this one:

[UIView imageNamed:mad:"myImage"]

some idea please ?
thanks a lot brothers.!
 

chbeer

macrumors member
Sep 22, 2008
82
0
Berlin
You should not have that many UIViews! You can change the image of an UIImageView programatically! You need only have 2 (current, next) or 3 (previous, current, next) views and change the images. That saves a LOT of memory and makes the application MUCH MORE responsive.
 

imaumac

macrumors member
Original poster
Oct 15, 2008
52
0
thanks for your answer.
please, realy please !
could you guide me how to do this ?

and i want to add, that I use buttons to show pictures on every UIView.
and here is the code that I use to show and hide pictures by pressing a button.

- (IBAction) call_image1: (id) sender {
[jpg_image1 setHidden:NO];}

- (IBAction) call_image1_hide: (id) sender {
[jpg_image1 setHidden:YES];}

dont know if this help.
but i realy need to learn how change the :
UIImageView
UIView
and buttons just with xcode.

please help !
I learned this way, jumping between UIViews
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.