Application crashing on iPhone
<p>I am developing an game in which i have to load images on finger swipe. For this i loaded all image 22 of size (788x525) at loading of the view itself. Then on finger swipe i just added image on view.</p>

<p>This works fine on iTouch but on iPhone game crashes after showing near about 12 images.</p>

<p>This is how i added images, graphicsArray is NSMUTableArray.</p>

<pre><code>for ( int i=0; i&lt;=totalNoofPages;i++){
    NSString * graphicsFileName = @"Page";
    graphicsFileName =
                [graphicsFileName
                 stringByAppendingString:[NSString stringWithFormat:@"%d", i]];
    UIImage *image =
               [[UIImage alloc] initWithContentsOfFile:
               [[NSBundle mainBundle] pathForResource:graphicsFileName
                                      ofType:@"jpg"]];
    GraphicsImages =
               [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 480,320 )];
    GraphicsImages.image = image;
    [image release];
    [GraphicsImages setCenter:center];

    GraphicsImages.transform = CGAffineTransformMakeRotation(M_PI/2);
    [graphicsArray insertObject:GraphicsImages atIndex:i];
}
</code></pre>

<p>and on finger swipe i write,pageNo is number of page that will be displayed.</p>

<pre><code>GraphicsImages = [graphicsArray objectAtIndex:pageNo];
[self addSubview:GraphicsImages];
</code></pre>

<p>Is there any way to release the previous loaded image from sub view as it might be kept on stack or is it due to large image size????</p>

<p>Please help me in this situation.</p>

<p>Thanks in advance.</p>

<p>Regards,
Vishal.</p>
