Хорошо, вот странный!
это код:
@ synthesize imageViewX, myScrollViewX;
- (void)viewDidLoad {
imageViewX = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
imageViewX.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
imageViewX.contentMode = UIViewContentModeScaleAspectFit;
imageViewX.backgroundColor = [UIColor clearColor];
//self.view = imageView;
myScrollViewX.contentSize = CGSizeMake(imageViewX.frame.size.width, imageViewX.frame.size.height);
myScrollViewX.backgroundColor = [UIColor blackColor];
myScrollViewX.maximumZoomScale = 4.0;
myScrollViewX.minimumZoomScale = 1.0;
myScrollViewX.clipsToBounds = YES;
myScrollViewX.delegate = self;
CGPoint scrollCenter = [myScrollViewX center];
[imageViewX setCenter:CGPointMake(scrollCenter.x,
scrollCenter.y )];
[myScrollViewX addSubview:imageViewX];
self.view = myScrollViewX;
[myScrollViewX autorelease];
}
- (void)viewWillAppear:(BOOL)animated {
imageViewX.image = [stm.image valueForKey:@"image"];
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return imageViewX;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void)dealloc {
[super dealloc];
[imageViewX release];
[xray release];
}
@end
Вот ситуация: разверните приложение просмотра таблицы,выберите строку.перейдите в View1 с табличным представлением с табличным заголовком.tableheaderview получил две кнопки.Кнопка 1 позволяет перейти к описанному выше коду.button2 открывает вам вид с точно таким же кодом!
Если я вызову первую кнопку button1 и вернусь к View1 и вернусь к исходному виду, NO LEAKS Если я выберу другую строку, перейдите к View1 и выберите button1 и вернитесь кначальный вид НЕТ УТЕЧЕК 3 раза повезет !! Сделайте то же самое, что и выше ПОЛУЧИЛ УТЕЧКИ !!!
ПОЧЕМУ ????
Senario 2 выберите строку перейдите к View1 выберите кнопку1 перейдите к просмотрус кодом выше, назад, выберите button2 перейти к просмотру с точным кодом, как указано выше ПОЛУЧИЛ УТЕЧКИ !!!сводит меня с ума !!!!
HELP ???