ここで少し助けが必要です。モーダルでビューをロードしました。基本的に、このビューを閉じようとしていますが、ビューが終了した後もクラッシュし続けます。
* -[ PointInfoController endAppearanceTransition]: 割り当て解除されたインスタンス 0x74d5e90 に送信されたメッセージ
以下は .H ファイルです。
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
@class PointInfoController;
@protocol PointInfoDelegate
- (void)PointInfoDidFinish:(PointInfoController*)PointInfoController;
@end
@interface PointInfoController : UIViewController <UIScrollViewDelegate>
{
IBOutlet UIScrollView *scrollView;
IBOutlet UIImageView *thumbnailView;
IBOutlet UIButton *Dismiss;
id<PointInfoDelegate> delegate;
}
@property (retain) id<PointInfoDelegate> delegate;
@property (retain, nonatomic) IBOutlet UITextView *description;
@property (retain, nonatomic) IBOutlet UIScrollView *scrollView;
@property (retain, nonatomic) IBOutlet UIImageView *thumbnailView;
- (IBAction)DismissView:(id)sender;
@end
以下は .M ファイルです。
#import "PointInfoController.h"
#import "LockOnLocation.h"
@implementation UIScrollView (AutoContentSize)
- (void) setAutosizeContent:(BOOL)autosizeContent {
if (autosizeContent) {
CGFloat contentWidth =
self.frame.size.width == self.superview.frame.size.width ?
self.superview.frame.size.width :
self.frame.size.width + 10;
CGFloat contentHeight =
self.frame.size.height == self.superview.frame.size.height ?
self.superview.frame.size.height :
self.frame.size.height + 164;
self.contentSize = CGSizeMake(contentWidth, contentHeight);
}
}
@end
@implementation PointInfoController
@synthesize description;
@synthesize scrollView;
@synthesize thumbnailView;
@synthesize delegate;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
self.scrollView.delegate = self;
[super viewDidLoad];
}
- (void)viewDidUnload
{
[self setDescription:nil];
[scrollView release];
scrollView = nil;
[self setScrollView:nil];
[self setThumbnailView:nil];
[thumbnailView release];
thumbnailView = nil;
[Dismiss release];
Dismiss = nil;
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (IBAction)DismissView:(id)sender
{
[self dismissModalViewControllerAnimated:YES];
[self release];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)dealloc {
[description release];
[scrollView release];
[thumbnailView release];
[Dismiss release];
[super dealloc];
}
@end