0

I have problems when running my application with xCode 6.1.1. In words, the application logs in into facebook and has to display another view. In console the only thing I see is "(lldb)", following here's the stack trace.

* thread #1: tid = 0xae9d1, 0x000000010a4158ad libswiftCore.dylib`swift_dynamicCastClassUnconditional + 77, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
  * frame #0: 0x000000010a4158ad libswiftCore.dylib`swift_dynamicCastClassUnconditional + 77
    frame #1: 0x000000010802867a ciao`ciao.ViewController.prepareForSegue (segue=0x00007f9271c653a0, sender=Some, self=0x00007f9271d87110)(ObjectiveC.UIStoryboardSegue, sender : Swift.Optional<Swift.AnyObject>) -> () + 890 at ViewController.swift:47
    frame #2: 0x000000010802894b ciao`@objc ciao.ViewController.prepareForSegue (ciao.ViewController)(ObjectiveC.UIStoryboardSegue, sender : Swift.Optional<Swift.AnyObject>) -> () + 75 at ViewController.swift:0
    frame #3: 0x000000010931e71c UIKit`-[UIStoryboardSegueTemplate _perform:] + 151
    frame #4: 0x000000010802a5de ciao`ciao.ViewController.(connection=Some, user=Some, error=None, self=0x00007f9271d87110) -> (Swift.ImplicitlyUnwrappedOptional<ObjectiveC.FBLoginView>, user : ObjectiveC.FBGraphUser) -> ()).(closure #1) + 1534 at ViewController.swift:39
    frame #5: 0x000000010802aa4a ciao`reabstraction thunk helper from @callee_owned (@owned Swift.ImplicitlyUnwrappedOptional<ObjectiveC.FBRequestConnection>, @owned Swift.ImplicitlyUnwrappedOptional<Swift.AnyObject>, @owned Swift.ImplicitlyUnwrappedOptional<ObjectiveC.NSError>) -> (@unowned ()) to @callee_unowned @objc_block (@unowned Swift.ImplicitlyUnwrappedOptional<ObjectiveC.FBRequestConnection>, @unowned Swift.ImplicitlyUnwrappedOptional<Swift.AnyObject>, @unowned Swift.ImplicitlyUnwrappedOptional<ObjectiveC.NSError>) -> (@unowned ()) + 90 at ViewController.swift:37
    frame #6: 0x0000000108032944 ciao`__51-[FBRequestConnection completeWithResults:orError:]_block_invoke657(.block_descriptor=0x00007f9271c63250, task=<unavailable>) + 65 at FBRequestConnection.m:1400
    frame #7: 0x000000010804b749 ciao`__39-[FBTask dependentTaskWithBlock:queue:]_block_invoke_2(.block_descriptor=0x00007f9271c63390) + 30 at FBTask.m:257
    frame #8: 0x000000010a80bba6 libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #9: 0x000000010a8297f4 libdispatch.dylib`_dispatch_client_callout + 8
    frame #10: 0x000000010a8128fb libdispatch.dylib`_dispatch_main_queue_callback_4CF + 949
    frame #11: 0x0000000108265fe9 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame #12: 0x0000000108228eeb CoreFoundation`__CFRunLoopRun + 2043
    frame #13: 0x0000000108228486 CoreFoundation`CFRunLoopRunSpecific + 470
    frame #14: 0x000000010d3269f0 GraphicsServices`GSEventRunModal + 161
    frame #15: 0x0000000108dcc420 UIKit`UIApplicationMain + 1282
    frame #16: 0x000000010802bcae ciao`top_level_code + 78 at AppDelegate.swift:12
    frame #17: 0x000000010802bcea ciao`main + 42 at AppDelegate.swift:0
    frame #18: 0x000000010a85e145 libdyld.dylib`start + 1

Anyone has suggestions?

Here's the prepareForSegue function :

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

        if (segue.identifier=="showView"){
            var vc:NewViewController = segue.destinationViewController as NewViewController
            vc.firstName=self.firstName
            vc.lastName=self.lastName
            vc.email=self.email
        }

    }
8
  • There is a reference to a prepareForSegue call. Could you show us this part of your code ?
    – KIDdAe
    Feb 17, 2015 at 13:04
  • 1
    If you put a breakpoint on the vc:NewViewController = ... line, what kind of object is segue.destinationViewController reported as by the debugger? Feb 17, 2015 at 13:20
  • Is the Valid Architecture or Support Platforms wrong? Check Build Settings -> Valid Architecture or Support Platforms. Does FB support architecture i386?
    – passwind
    Feb 17, 2015 at 13:31
  • @PhillipMills I tried what you suggest and get that segue.destinationViewController is of type UITabBarController
    – geek4079
    Feb 17, 2015 at 13:37
  • Sounds like there's something wrong with your segue since it's giving you a type of controller that doesn't match what you expect. It all seems a bit odd since a UITabBarController should only be used as a top-level controller and certainly not a segue destination. Feb 17, 2015 at 13:48

1 Answer 1

0

Is NewViewController embedded in a navigation controller?

Then maybe you could try this:

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

    if (segue.identifier=="showView"){
       let navigationController = segue.destinationViewController as UINavigationController 
let vc = navigationController.topViewController as NewViewController
        vc.firstName=self.firstName
        vc.lastName=self.lastName
        vc.email=self.email
    }
}

Other potential culprits include the segue identifier, although this would probably produce a more helpful error message.

Do what @PhilipMills suggested and check what is the actual destination controller at runtime.

3
  • having an UITabBarController I don't have a topViewController
    – geek4079
    Feb 17, 2015 at 13:43
  • Why do you need a segue then?
    – joakim
    Feb 17, 2015 at 13:54
  • In my first view controller I have the FB Login Button, and after a successful login I want to redirect the user to a view where he can navigate using the tab bar.. I need to perform the segue between the first view controller and the UITabBarController
    – geek4079
    Feb 17, 2015 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.