내 루트보기 컨트롤러의 릴리스 방법은 38 번 호출되지만 release는 호출하지 않습니다. 왜 발생합니까? 많은 시간 동안 호출 된 Objective-C 릴리즈
@interface ViewController()
@end
@implementation ViewController
-(oneway void)release
{
NSLog(@"release called");
[super release];
}
@end
@implementation AppDelegate
- (void)dealloc
{
[_window release];
[_viewController release];
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
2013-04-09 19:47:36.060 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.063 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.064 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.065 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.065 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.066 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.067 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.068 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.072 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.073 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.074 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.075 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.077 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.080 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.081 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.081 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.082 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.108 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.110 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.111 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.112 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.134 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.144 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.158 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.161 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.170 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.180 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.182 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.193 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.197 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.198 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.199 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.202 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.208 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.208 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.218 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.220 TesteRelease[44985:c07] release called
2013-04-09 19:47:36.220 TesteRelease[44985:c07] release called
outpout 나는 ARC를 사용하지 않는.
보기 컨트롤러 개체는 여러 프레임 워크 개체로 전달할 수 있습니다. 또한 ARC를 사용하지 않아도 Apple이 수행 할 수 있습니다. ARC는 유지/릴리스를 호출 할 때 빛이 아닙니다. 어쨌든 로그를 해제하는 것은 적절하지 않다고 생각합니다. 'dealloc'이 호출 될 때만 문제가 될 것입니다. – zneak