I have an app project that I have been developing that, within the app, shows a view of a plan of a building in a modalViewController. The user can scroll around and zoom in or out to a controlled degree. I seem to have a memory issue, even though xcode doesn't report anything. The plan graphic is about 1.2mb, and the size of the graphic may be part of the issue. If so, is there any advice on using images in this way.
I've got to the point where I just stare at it and can't see the wood for the trees. For instance, do I have to release tempImageView?
I am working in Xcode 3.2.6 at the moment and I get no errors or issues reported.
If someone could let me have an appraisal of this code, I would appreciate the help.
I've got to the point where I just stare at it and can't see the wood for the trees. For instance, do I have to release tempImageView?
I am working in Xcode 3.2.6 at the moment and I get no errors or issues reported.
Code:
- (void)viewDidLoad {
UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Buildingplan.jpg"]];
self.imageView = tempImageView;
scrollView.contentSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height);
[scrollView setContentOffset:CGPointMake(685.0f, 315.0f)];
scrollView.maximumZoomScale = 2.1;
scrollView.minimumZoomScale = .6;
scrollView.clipsToBounds = YES;
[scrollView setDelegate:(id<UIScrollViewDelegate>)self];
[scrollView addSubview:imageView];
scrollView.contentSize = CGSizeMake(imageView.image.size.width*0.50,
imageView.image.size.height*0.50);
imageView.frame = CGRectMake(imageView.frame.origin.x,
imageView.frame.origin.y,
imageView.frame.size.width*0.50,
imageView.frame.size.height*0.50);
[imageView release];
[scrollView release];
[super viewDidLoad];
}
If someone could let me have an appraisal of this code, I would appreciate the help.