다른 프로젝트에서 복사 한 코드와 정확히 같은 코드가 있기 때문에 그 문장에 어떤 문제가 있는지 알 수는 없지만 모든 것이 정상적으로 보일 때 EXC_BAD_ACCESS를 계속 던지고 있습니다. 아무도 문제를 정확히 지적 할 수 있습니까? 이 오류가 몇 시간 동안 있었고 동일한 코드가 잘못된 액세스와 같은 다른 결과를 생성하거나 흰색 화면이 나타나는 등 많은 도움을 받았습니다.EXC_BAD_ACCESS 릴리스 문 사용시의 문제점
코드 조각은 :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
NSLog(@"0");
UINavigationController * localNavigationController;
tabBarController = [[UITabBarController alloc] init];
NSMutableArray * localControllersArray = [[NSMutableArray alloc] initWithCapacity:4];
//ProductViewController
ProductViewController * productViewController;
productViewController = [[ProductViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController: productViewController];
[localControllersArray addObject:localNavigationController];
NSLog(@"1");
// memory statements
[localNavigationController release];
[productViewController release];
//Search View Controller
SearchViewController * searchViewController;
searchViewController = [[SearchViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController: searchViewController];
[localControllersArray addObject:localNavigationController];
// memory statements
[localControllersArray release];
[searchViewController release];
NSLog(@"2");
//Register View Controller
RegisterViewController * registerViewController;
registerViewController = [[RegisterViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController:registerViewController];
[localControllersArray addObject:localNavigationController];
NSLog(@"3");
//memory management
[localControllersArray release];
[registerViewController release];
//About View Controller
AboutViewController * aboutViewController;
aboutViewController = [[AboutViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc] initWithRootViewController: aboutViewController];
[localControllersArray addObject:localNavigationController];
//memory management
[localNavigationController release];
[aboutViewController release];
NSLog(@"4");
// Override point for customization after application launch.
tabBarController.viewControllers = localControllersArray;
[window addSubview:tabBarController.view];
// Override point for customization after application launch.
[self.window makeKeyAndVisible];
return YES;
NSLog 문제가 어디에 있는지 볼 수 있었다. [localNavigationController release] 이후에는 3이 표시되지 않습니다.
프로젝트를 첨부했습니다. 사전에
http://www.mediafire.com/?eauye5s361cyej0
감사합니다.
대신 코드 조각을 사용 하시겠습니까? – Eimantas
죄송합니다. 전체 프로젝트를 다운로드하여 압축을 풀지 않은 다음 오류가 어디 있는지 추측 할 것입니다. 질문에 몇 가지 코드를 게시하십시오. – JeremyP