我正在使用 Apple果工具“地点”工具,并且注意到,在我回头提出两种观点时,分配总是在增加。 在调查中,我发现,所有记忆都来自我方言中方言。
我接受检查,我的《国际调查评论》正在处理中,但看来《国际调查意见》不是吗? I m 不再保留统一意见书控制员的意见。 没有人有什么想法?
我在此写道,要改变观点。
UISubViewController *viewController = [UIViewControllerFactory createViewController:viewControllerID]; // Creates and returns a UIViewController by ID
[currentViewController viewWillDisappear:YES];
[currentViewController.view removeFromSuperview];
[currentViewController viewDidDisappear:YES];
[viewController viewWillAppear:YES];
[self.view insertSubview:viewController.view atIndex:0];
[viewController viewDidAppear:YES];
self.currentViewController = viewController;
[viewController release];
Edit:
Ok, because there was concern that I was just using a ViewController s View and then releasing the ViewController, I tried an experiment where I made a new class that is the File s Owner in the NIB, but inherits from NSObject.
该法典现在看着这一点:
MyView *myView = [[MyView alloc] initWithNibName:@"myView"];
[currentView viewWillDisappear:YES];
[currentView.view removeFromSuperview];
[currentView viewDidDisappear:YES];
[myView viewWillAppear:YES];
[self.view insertSubview:myView.view atIndex:0];
[myView viewDidAppear:YES];
self.currentView = myView;
[myView release];
我的初衷是:
@interface MyView : NSObject {
IBOutlet UIView *view;
NSArray *nibTopLevelObjects;
}
@property (nonatomic, retain) UIView *view;
- (id)initWithNibName:(NSString *)nibName;
@end
@implementation MyView
@synthesize view;
- (id)initWithNibName:(NSString *)nibName {
if (self = [super init]) {
nibTopLevelObjects = [[NSBundle mainBundle] loadNibNamed:nibName owner:self options:nil];
[nibTopLevelObjects retain];
}
return self;
}
- (void)dealloc {
[view release];
[nibTopLevelObjects release];
view = nil;
nibTopLevelObjects = nil;
[super dealloc];
}
@end
我仍然看到,我每次交换和发表新看法时,都发现了对观点的记忆泄露。
任何新想法?