2013-06-25 61 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