@interface Objective_C_LibraryViewController : UIViewController {
IBOutlet UIButton *enterSecondMenu;
}
-(IBAction)enterSecondMenu:(id)sender;
@end
@implementation Objective_C_LibraryViewController
-(IBAction)enterSecondMenu:(id)sender {
SecondMainMenu *enterSecondMenu = [[SecondMainMenu alloc]initWithNibName:Nil bundle:Nil];
[self presentModalViewController: enterSecondMenu animated:YES];
}
當我按下接收到的插座連接的UIButton時,它會收到一個SIGABRT。切換視圖時出現SIGABRT
如果你不是從筆尖加載SecondMainMenu,爲什麼不使用: [SecondMainMenu的alloc]初始化] ? – Maggie
視圖是否在.h文件中正確實現了視圖? – ApolloSoftware
@Elmir你的代碼是絕對正確的我在我的mac中運行這段代碼它工作正常,你做1件事情檢查ibaction方法與uibutton的連接性,並檢查SecondMainMenu xib,它是否正確地與文件所有者連接,嘗試它並嘗試也回覆反饋 –