1

I've run into an annoying issue when trying to segue to a Pages View Controller from my initial UIViewController. My initial UIViewController, among other things, includes a UITextField. Everytime I attempt to segue out of my initial UIViewController after I've used the UITextField at all, the app crashes with the error below. If I don't interact with the UITextField I seem to be able to use segues at will. From reading other posts I'm lead to believe there are some resources being used by the UITextField that I'm not properly releasing, but after trying numerous longshot attempts at fixing it, I'm left out of ideas/knowledge.

Error Message:

2015-05-22 20:10:13.961 checkdgt[7503:506991] -[checkdgt.ViewController textFieldCancel:]: unrecognized selector sent to instance 0x7f8750826e00
2015-05-22 20:10:14.033 checkdgt[7503:506991] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[checkdgt.ViewController textFieldCancel:]: unrecognized selector sent to instance 0x7f8750826e00'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010bd00c65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010df63bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x000000010bd080ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x000000010bc5e13c ___forwarding___ + 988
    4   CoreFoundation                      0x000000010bc5dcd8 _CF_forwarding_prep_0 + 120
    5   UIKit                               0x000000010cc5dda2 -[UIApplication sendAction:to:from:forEvent:] + 75
    6   UIKit                               0x000000010cd6f54a -[UIControl _sendActionsForEvents:withEvent:] + 467
    7   UIKit                               0x000000010cd6e09a -[UIControl cancelTouchTracking] + 44
    8   UIKit                               0x000000010cd6eadd -[UIControl _didMoveFromWindow:toWindow:] + 89
    9   UIKit                               0x000000010ccd774a -[UIView(Internal) _didMoveFromWindow:toWindow:] + 698
    10  UIKit                               0x000000010ccd774a -[UIView(Internal) _didMoveFromWindow:toWindow:] + 698
    11  UIKit                               0x000000010cccfecf __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 125
    12  UIKit                               0x000000010cccfe43 -[UIView(Hierarchy) _postMovedFromSuperview:] + 437
    13  UIKit                               0x000000010cccdfa3 -[UIView(Hierarchy) removeFromSuperview] + 479
    14  UIKit                               0x000000010cd6c4dc __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke504 + 657
    15  UIKit                               0x000000010cd684f2 -[UIPresentationController transitionDidFinish:] + 87
    16  UIKit                               0x000000010d31a2ed -[_UIFullscreenPresentationController transitionDidFinish:] + 70
    17  UIKit                               0x000000010cd6ab7c __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 133
    18  UIKit                               0x000000010d3a97c0 -[_UIViewControllerTransitionContext completeTransition:] + 110
    19  UIKit                               0x000000010cd65be3 -[UITransitionView _didCompleteTransition:] + 1120
    20  UIKit                               0x000000010ccbc136 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 209
    21  UIKit                               0x000000010ccbc46c -[UIViewAnimationState animationDidStop:finished:] + 76
    22  QuartzCore                          0x000000010ca43882 _ZN2CA5Layer23run_animation_callbacksEPv + 308
    23  libdispatch.dylib                   0x000000010e693614 _dispatch_client_callout + 8
    24  libdispatch.dylib                   0x000000010e67ba1c _dispatch_main_queue_callback_4CF + 1664
    25  CoreFoundation                      0x000000010bc681f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    26  CoreFoundation                      0x000000010bc29dcb __CFRunLoopRun + 2043
    27  CoreFoundation                      0x000000010bc29366 CFRunLoopRunSpecific + 470
    28  GraphicsServices                    0x000000010f88ba3e GSEventRunModal + 161
    29  UIKit                               0x000000010cc5c900 UIApplicationMain + 1282
    30  checkdgt                            0x000000010b1f3f87 main + 135
    31  libdyld.dylib                       0x000000010e6c7145 start + 1
    32  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Last bit of code before the segue is called:

@IBAction func learnButtonPressed(sender: UIButton) {

    view.endEditing(true)
    textInputFieldOutlet.resignFirstResponder()
    textFieldShouldEndEditing(textInputFieldOutlet)
    performSegueWithIdentifier("LearnPagesSegue", sender: nil)
}

I can't find any methods or objects in my code named -textFieldCancel, and the only other UITextField I can think of would be in the included CardIO library, which doesn't seem to be the suspect.

I'm using Xcode 6.3.2 and the latest version of Swift.

Any help or gentle nudges are appreciated.

Thanks!

Schemetrical
  • 5,506
  • 2
  • 26
  • 43
beatsbears
  • 201
  • 2
  • 7

1 Answers1

4

Check that there isn't an old connection from your button by right clicking on it in the storyboard and examining the outlets in the list. You may have an old connection that you forgot to eliminate.

Tim Quinn
  • 183
  • 5