2013-06-25 63 views
0

刚刚在Xcode上启动不同项目时(单视图,主细节,...) 我总是遇到线程1:Signal sigabrt warning,它会停止我的iOS模拟器。添加视图时的信号sigabrt

对于这个模拟,我从一个视图项目开始,一个按钮链接到另一个视图。即使我是iOS开发世界的新手,也没什么复杂的。

谢谢你帮我

Thread backtrace : 
2013-06-25 18:54:39.356 App4[1313:11303] *** Terminating app due to uncaught exception   'NSGenericException', reason: 'Push segues can only be used when the source controller is  managed by an instance of UINavigationController.' 
*** First throw call stack: 
(0x1c90012 0x10cde7e 0x467f31 0x459b99 0x459c14 0x10e1705 0x152c0 0x15258 0xd6021 0xd657f  0xd56e8 0x44cef 0x44f02 0x22d4a 0x14698 0x1bebdf9 0x1bebad0 0x1c05bf5 0x1c05962 0x1c36bb6  0x1c35f44 0x1c35e1b 0x1bea7e3 0x1bea668 0x11ffc 0x1fad 0x1ed5 0x1) 
libc++abi.dylib: terminate called throwing an exception 

#import <UIKit/UIKit.h> 

@interface CalViewController : UIViewController 

@end 


#import <UIKit/UIKit.h> 

@interface CalAppDelegate : UIResponder <UIApplicationDelegate> 

@property (strong, nonatomic) UIWindow *window; 

@end 


#import "CalViewController.h" 

@interface CalViewController() 

@end 

@implementation CalViewController 

- (void)viewDidLoad 
{ 
[super viewDidLoad]; 
// Do any additional setup after loading the view, typically from a nib. 
} 

- (void)didReceiveMemoryWarning 
{ 
    [super didReceiveMemoryWarning]; 
    // Dispose of any resources that can be recreated. 
} 

@end 

回答

0

确保您的按钮的方法为之被调用使用的是故事板,然后检查你的按钮的和视图的connection.Also检查赛格瑞是两者之间正确设置views.If问题仍然坚持尝试逐行调试您的代码。希望这可能会有所帮助。

0

问题不在于连接,而是您尝试将新的视图控制器推送到您的导航控制器,但您的应用程序不使用导航控制器。你可以用几种方法解决这个问题。首先,如果你想要一个导航控制器,把你的根视图放在导航控制器里面,然后push segue就可以工作,或者你可以把segue的类型改成类似modal或replace的东西。

+0

在契税,它的工作原理。谢谢 ! – GoldXApp