iPad にアプリケーションがあり、クラッシュして再起動が発生します。このクラッシュは、メソッド showMap:(Mappe *mappa) の後のどこかで発生します。
- (void)viewDidLoad {
moc = [[MapFetcher sharedInstance] managedObjectContext];
[NSThread detachNewThreadSelector:@selector(fetchMap) toTarget:self withObject:nil];
[super viewDidLoad];
}
- (void)fetchMap {
NSAutoreleasePool *threadPool = [[NSAutoreleasePool alloc] init];
Mappe *mappa;
mappa = [[[MapFetcher sharedInstance] fetchManagedObjectsForEntity:@"Mappe"
withPredicate:[NSPredicate predicateWithFormat:@"Citta == %@", map]
withDescriptor:@"Citta"] objectAtIndex:0];
[self performSelectorOnMainThread:@selector(showImage:) withObject:mappa waitUntilDone:YES];
[threadPool release];
}
- (void)showImage:(Mappe *)mappa {
imvMappa = [[UIImageView alloc] initWithFrame:CGRectMake( 0.0, 0.0, 1024.0, 704.0 )];
[imvMappa setImage:[UIImage imageWithData:[mappa Mappa]]];
[scrollView addSubview:imvMappa];
[scrollView setContentSize:CGSizeMake( 1024.0, 704.0 )];
[scrollView setMinimumZoomScale:0.5];
[scrollView setMaximumZoomScale:4.0];
[scrollView setZoomScale:1.0];
[scrollView setContentMode:(UIViewContentModeScaleAspectFit)];
[scrollView setClipsToBounds:YES];
[scrollView setDelegate:self];
[imvMappa release];
[loadingImage stopAnimating];
[waitFor setHidden:YES];
[scrollView setHidden:NO];
}
scrollView はアウトレット、Mappe はマネージド オブジェクトであり、アプリ内のあらゆる場所で使用しているため問題なく動作するはずです。私は本当に立ち往生しています.クラッシュアンドリブートを引き起こす可能性があるのは何ですか?
編集:メモリ分析
Instruments - Memory Monitor を使用して何が起こっているかを確認したところ、起動時にアプリケーションが 17 MB のメモリを使用していることが示されましたが、割り当てには次のように表示されています: Live Bytes 883 KB、全体で 4MB。少し混乱しています... 上記のコードを起動すると、次のように表示されます。 2MB のライブ バイト (4 つの ViewController) 全体で 22 MB ですが、メモリ モニターでは 77 MB の実メモリと表示されます。状況の実際のレポートを得るには、何を見ればよいですか?