バーコントローラ 私のプロジェクト名は、 "AddDebtor"と "Debtor"の表示を切り替える "DebtDevV1"です。私はそれを "タブベースのアプリケーション"に基づいて構築しました。デバッグエラーmain.c内のEXC_BAD_ACCESS
私は "DebtorViewController" を押すと、それは エラーメッセージmain.mでコーディング以下で停止:私はDebtDevV1AppDelegateに私にカーソルを置くとき
プログラムは、信号 "EXC_BAD_ACCESS"
を受けそれは"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を使用して「自動解除」を削除してください。 –
deallocメソッドはどのように見えますか? – syclonefx
申し訳ありませんが、私はARCとは何ですか?また、私はすべての[... autorelease]コードを削除する必要があるという意味ですか?またはどのautoreleaseを削除するには? –