0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<Test.gameView_ViewController: 0x145669e10>) has no segue with identifier 'backSegue''  

*** First throw call stack:
(0x1842c0f5c 0x198eb3f80 0x189b7b774 0x10005c5a0 0x100054b14 0x101151d70 0x101151d30 0x101157780 0x184278258 0x1842760c0 0x1841a4dc0 0x18f2f8088 0x18987ef60 0x10005d0c0 0x1996de8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

And this is the code:

func stream(aStream: NSStream, handleEvent eventCode: NSStreamEvent) {  
    switch(eventCode){  


    case NSStreamEvent.HasBytesAvailable:  

        var buffer = [UInt8](count: 4096, repeatedValue: 0)  


        if ( aStream == GlobalVariables.inputStream){  

            while (GlobalVariables.inputStream!.hasBytesAvailable){  
                let len = GlobalVariables.inputStream!.read(&buffer, maxLength: buffer.count)  
                if(len > 0){  
                    let output = NSString(bytes: &buffer, length: buffer.count, encoding: NSUTF8StringEncoding)!.stringByTrimmingCharactersInSet(  
                        NSCharacterSet.whitespaceAndNewlineCharacterSet())  
                    if (output != ""){  
                        /  

                        /  
                        var buf = UnsafeMutablePointer<CChar>(buffer)  

                        var bufString: String = String.fromCString(buf)!  

                        if ((delegate) != nil){  
                            delegate!.dataReceived(bufString)  
                        }  

                    }  
                }  
            }  


        }  


        break  

    case NSStreamEvent.OpenCompleted:  

        break  

    default: break  

    }  


}  

1 Answers1

0

Clearly you are not calling your segue on correct object. Please ensure you are calling performSegueWithIdentifier: function on the right object. For instance:

This is correct:

[self performSegueWithIdentifier:@"backSegue" sender:self];

And this is incorrect:

[self.navigationController performSegueWithIdentifier:@"backSegue" sender:self];
Abhinav
  • 37,684
  • 43
  • 191
  • 309