memory management

28 views
Skip to first unread message

ivano.malavolta

unread,
Dec 1, 2011, 6:13:59 PM12/1/11
to Leaves Developers
Hi all,
I am working on an app in which I need to manage a gallery of 150
large-sized images.

I would like to reuse the ImageExample of Leaves, but I am afraid that
with such a high
number of large-sized images I will have big memory problems, can you
confirm me that?
Or, in Leaves memory is managed somewhere else within the framework?

Cheers,
Ivano

Ryan Duckworth

unread,
Dec 1, 2011, 8:33:50 PM12/1/11
to leaves-d...@googlegroups.com, ivanoma...@gmail.com
Ivano,

Leaves cache only holds 3 in memory:
- previous
- current
- next

Please let me know if you need help with your project.

Best,
Ryan

Sent from my iPhone

Ivano Malavolta

unread,
Dec 2, 2011, 3:37:27 AM12/2/11
to Ryan Duckworth, leaves-d...@googlegroups.com
Hi Ryan,
thanks very much for the quick reply.
The problem is that in the example file:

https://github.com/shuhongwu/leaves-zoom-enhanced/blob/master/Classes/ImageExampleViewController.m

I see this:

- (id)init {
if (self = [super init]) {
images = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"kitten.jpg"],
[UIImage imageNamed:@"kitten2.jpg"],
[UIImage imageNamed:@"kitten3.jpg"],
nil];
}
return self;
}

And I got quite scared of the various imageNamed calls!
My scenario is that I have 150 jpg images to show (I got them from a PDF),
each image is around 1 Mb.

Do you have any suggestions on how I could proceed from here?
At the moment, I am thinking to develop by myself a scrollview with
zoom and paging,
in which I can load and dealloc the images when needed...

Cheers,
Ivano

2011/12/2 Ryan Duckworth <ryan.du...@gmail.com>:

--
-----

Ivano Malavolta, PhD student
Department of Computer Science
University of L'Aquila
phone: +390862433734  skype: iivanoo
web: http://www.di.univaq.it/malavolta

Reply all
Reply to author
Forward
0 new messages