views:

81

answers:

2

Hi all,

I need a clarification from all of you,That is I am implementing an iPad application. In that I tried to download and animate the images. The image count should be more than 100,000.The code I used to download and adding to the view is as follows.

UIImageView* imageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0,100,100)];
NSData *receivedData=nil;
receivedData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://path/prudently/iphone/image_s/e545afbf-4e3e-442e-92f9-a7891fc3ea9f/test.png"]];
imageView.image = [[UIImage alloc] initWithData:receivedData] ;
[subView addSubview:imageView];
[imageView release];

But I am getting exception after I successfully added more than 8000 image to my subview. I am getting exception at getting data from the url. And one more thing I am not releasing the subview because once I downloaded them I need to animate the subview.

Please give me your suggessions

Thank you, Sekhar Bethalam.

+1  A: 

100,000 images would seem a lot for desktop applications, let alone a smart phone like an iPhone. Is there not another approach you can take to solve this problem that wouldn't need such a high resource count?

Paul Hadfield
@David: Hi I got this Program received signal: “EXC_BAD_ACCESS”.Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")
sekhar
A: 

The only way you are going to accomplish this is to dynamically create and destroy the UIImageViews as they are needed on the screen. The iPhone/iPad/iAnything are incapable of doing what you want because of the limited memory available on the device.

Tegeril
@Tegeril: But I had a problem with these I am not able to destroy them because the subview should be animated till the application closed. This is the requirement. If I do As you suggested I can't animate them. That is the problem,
sekhar
I don't understand the value of animating 100,000 100x100 pixel objects on a screen that can only show, at most (iPad), 70 instances of each image not overlapped.
Tegeril