2014-02-01 7 views
-1

У меня есть кнопка в viewcontroller, с которой я связан с другим ViewController.Переход между ViewControllers не работает

Об осуществлении первого ViewController Я создал этот метод:

- (IBAction)SignUpPressed:(id)sender { 
    [self performSegueWithIdentifier:@"signup" sender:self]; 
} 

Но когда я проверить его на тренажере, я нажимаю кнопку, и приложение вылетает

argc int 1 1 
argv char ** 0x7fff5fbfece8 0x00007fff5fbfece8 


libc++abi.dylib: terminating with uncaught exception of type NSException 

Возвращение этой ошибки , Что я могу сделать, чтобы исправить это?

ПРИЛОЖЕНИЕ:

Код по ошибке (весь код выше точек ошибки)

#import "LoginViewController.h" 
    #import "ADVTheme.h" 

    @interface LoginViewController() 

    @end 

    @implementation LoginViewController 



    - (void)viewDidLoad 
    { 
     [super viewDidLoad]; 

     id <ADVTheme> theme = [ADVThemeManager sharedTheme]; 

     [self.view setBackgroundColor:[UIColor colorWithPatternImage:[theme viewBackground]]]; 



     [self.loginButton setBackgroundImage:[theme colorButtonBackgroundForState:normal] forState:UIControlStateNormal] ; 

     [self.loginButton setBackgroundImage:[theme colorButtonBackgroundForState:UIControlStateHighlighted] forState: UIControlStateHighlighted]; 
    } 

    - (void)viewDidAppear:(BOOL)animated { 
     [super viewDidAppear:animated]; 
     self.title = @"Login"; 
    } 

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

    #pragma mark - Table view data source 

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
    { 

     // Return the number of sections. 
     return 0; 
    } 

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
    { 

     // Return the number of rows in the section. 
     return 0; 
    } 

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    { 
     static NSString *CellIdentifier = @"Cell"; 
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 

     // Configure the cell... 

     return cell; 
    } 

All exception Traceback 


014-02-01 11:55:05.904 theBeeGame[15793:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<LoginViewController: 0x10982c3b0>) has no segue with identifier 'signup'' 
*** First throw call stack: 
(
    0 CoreFoundation      0x0000000101f90795 __exceptionPreprocess + 165 
    1 libobjc.A.dylib      0x0000000101cf3991 objc_exception_throw + 43 
    2 UIKit        0x0000000100a43e05 -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0 
    3 theBeeGame       0x0000000100005cf1 -[LoginViewController SignUpPressed:] + 97 
    4 UIKit        0x0000000100957096 -[UIApplication sendAction:to:from:forEvent:] + 80 
    5 UIKit        0x0000000100957044 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 17 
    6 UIKit        0x0000000100a2b450 -[UIControl _sendActionsForEvents:withEvent:] + 203 
    7 UIKit        0x0000000100a2a9c0 -[UIControl touchesEnded:withEvent:] + 530 
    8 UIKit        0x000000010098bc15 -[UIWindow _sendTouchesForEvent:] + 701 
    9 UIKit        0x000000010098c633 -[UIWindow sendEvent:] + 988 
    10 UIKit        0x0000000100965fa2 -[UIApplication sendEvent:] + 211 
    11 UIKit        0x0000000100953d7f _UIApplicationHandleEventQueue + 9549 
    12 CoreFoundation      0x0000000101f1fec1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 
    13 CoreFoundation      0x0000000101f1f792 __CFRunLoopDoSources0 + 242 
    14 CoreFoundation      0x0000000101f3b61f __CFRunLoopRun + 767 
    15 CoreFoundation      0x0000000101f3af33 CFRunLoopRunSpecific + 467 
    16 GraphicsServices     0x000000010293c3a0 GSEventRunModal + 161 
    17 UIKit        0x0000000100956043 UIApplicationMain + 1010 
    18 theBeeGame       0x0000000100002ed3 main + 115 
    19 libdyld.dylib      0x00000001033295fd start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 
+0

Проверьте и убедитесь, что ваши 'IBAction' или' IBOutlet' в вашей раскадровке правильно подключены. – Buntylm

+2

Показать полное сообщение об исключении и трассировку стека. Является ли идентификатор segue действительным? – Wain

+0

Я добавил на вкладке Identity, RestorationID как «signup». Я обновил свой вопрос с полным исключением –

ответ

1

Пожалуйста, укажите свой идентификатор segue "signup" на контроллере stoarybord.

+0

Я добавил на вкладке Identity, RestorationID как «регистрацию», но не работал –

+0

уже знаю, что такое segue –

1

конвенция о прошивке должны иметь метод, начиная со строчной и верблюжьим. Убедитесь, что ваш элемент управления подключен к правильному IBaction (с учетом регистра!). Также убедитесь, что ваш идентификатор segue точно совпадает (с учетом регистра).

Наконец, покажите полное исключение, трассировку стека и код вокруг места, где происходит исключение (для этого задайте контрольную точку исключения).

+0

Я добавил в LoginButton на вкладке Identity, RestorationID как «зарегистрироваться», но не работал –

+0

уже знаю, что такое segue, спасибо! –

Смежные вопросы