bar controller, Мое название проекта - «DebtDevV1», который переключается между представлением «AddDebtor» и «Debtor». Я построил его на основе «приложения с вкладками».ошибка отладки EXC_BAD_ACCESS в main.m
Когда я нажимаю "DebtorViewController", он остановился на уровне ниже кодирования в main.m Сообщение об ошибке:
Программа получила сигнал "EXC_BAD_ACCESS"
Когда я кладу курсор на DebtDevV1AppDelegate, он показывает "Out of Scope"
.
Ниже main.m:
#import "DebtDevV1AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([DebtDevV1AppDelegate class]));
}
}
Ниже DebtDevV1AppDelegate.m
#import "DebtDevV1AppDelegate.h"
#import "AddDebtorViewController.h"
#import "DebtorViewController.h"
@implementation DebtDevV1AppDelegate
@synthesize window = _window;
@synthesize tabBarController = _tabBarController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
UIViewController *viewController1 = [[[AddDebtorViewController alloc] initWithNibName:@"AddDebtorViewController" bundle:nil] autorelease];
UIViewController *viewController2 = [[[DebtorViewController alloc] initWithNibName:
@"DebtorViewController" bundle:nil] autorelease];
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
Кто-нибудь сталкивался или имеет представление о том, выше ошибка? Спасибо!
Используйте ARC и удалите 'autorelease'. –
Как выглядят методы dealloc? – syclonefx
Извините, я могу знать, что такое ARC? Также вы имеете в виду, что мне нужно удалить все [... autorelease] код? или какой автореферат удалить? –