【问题标题】:SIGABRT error when trying to open a new page in xcode尝试在 xcode 中打开新页面时出现 SIGABRT 错误
【发布时间】:2011-09-04 18:53:37
【问题描述】:

我正在尝试测试我的应用程序,但是当我在模拟器或实际设备上对其进行测试时,我会在关卡选择页面上启动应用程序,但是,当我尝试点击关卡时,我得到错误 Thread 1: Program received signal: "SIGABRT"。 我在转换样式的代码中收到此错误,当我尝试删除转换时,应用程序仍然收到错误,但在不同的地方。关于如何解决这个问题的任何想法?这是我的代码:

MainViewController.h

#import "FlipsideViewController.h"
#import "MediumViewController.h"
#import "HardViewController.h"

@interface MainViewController : UIViewController <FlipsideViewControllerDelegate, MediumViewControllerDelegate, HardViewControllerDelegate> {
    UIButton *buttonEasy;
    UIButton *buttonMedium;
    UIButton *buttonHard;
}

@property (nonatomic, retain) IBOutlet UIButton *buttonEasy;
@property (nonatomic, retain) IBOutlet UIButton *buttonMedium;
@property (nonatomic, retain) IBOutlet UIButton *buttonHard;

- (IBAction)showEasy:(id)sender;
- (IBAction)showMedium:(id)sender;
- (IBAction)showHard:(id)sender;

@end

MainViewController.m

@implementation MainViewController

@synthesize buttonEasy;
@synthesize buttonMedium;
@synthesize buttonHard;

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller
{
    [self dismissModalViewControllerAnimated:YES];
}

- (void)MediumViewControllerDidFinish:(MediumViewController *)controller
{
    [self dismissModalViewControllerAnimated:YES];
}

- (void)HardViewControllerDidFinish:(HardViewController *)controller
{
    [self dismissModalViewControllerAnimated:YES];
}

- (IBAction)showEasy:(id)sender
{    
    FlipsideViewController *controller = [[FlipsideViewController alloc]     initWithNibName:@"FlipsideView" bundle:nil];
    controller.delegate = self;

    controller.modalTransitionStyle = UIModalTransitionStylePartialCurl;
    [self presentModalViewController:controller animated:YES];

    [controller release];
}

- (IBAction)showMedium:(id)sender
{
    MediumViewController *controller = [[MediumViewController alloc initWithNibName:@"MediumViewController" bundle:nil];
    controller.delegate = self;

    controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controller animated:YES];

    [controller release];
}

- (IBAction)showHard:(id)sender
{
    HardViewController *controller = [[HardViewController alloc] initWithNibName:@"HardViewController" bundle:nil];
    controller.delegate = self;

    controller.modalTransitionStyle = UIModalTransitionStylePartialCurl;
    [self presentModalViewController:controller animated:YES];

    [controller release];
}

【问题讨论】:

  • 调试器控制台中没有其他错误描述或堆栈跟踪吗?
  • 另外,SIGABRT 指示在哪一行?
  • 是的,没有上下文很难说,添加堆栈跟踪。

标签: iphone ios xcode xcode4 modalviewcontroller


【解决方案1】:

我建议你仔细检查你的 NIB 文件的名称,我之前有过类似的经历,发现我拼错了 NIB 文件名。

【讨论】:

  • 没关系,我想通了,谢谢。我都忘记了一封信,不知道我以前是怎么错过的
  • 太棒了!如果您将我标记为答案,我会很高兴 - 单击向上/向下箭头下的复选标记 :)
【解决方案2】:

如果调试器控制台中没有更多信息,请尝试启用僵尸,因为这会告诉您是否存在内存问题:启用僵尸(Xcode 4)单击产品>编辑方案>运行(项目名称)>环境变量添加:NSZombieEnabled。然后在值字段中为 YES。清理并重建。

【讨论】:

    【解决方案3】:

    我建议您检查您的 IB 连接。如果您链接了一个 Outlet,然后更改其名称或其他内容,它会崩溃

    【讨论】:

      猜你喜欢
      • 2023-01-27
      • 2016-11-13
      • 1970-01-01
      • 2017-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-29
      相关资源
      最近更新 更多