Receiver has no segue with identifier error - ios

I am getting an error
2014-04-09 01:42:23.599 appname[9584:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<LoginViewController: 0x9a9cda0>) has no segue with identifier 'login''
*** First throw call stack:
(
0 CoreFoundation 0x0263c1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x023bb8e5 objc_exception_throw + 44
2 UIKit 0x0119c48c -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0
3 appname 0x00002fea -[LoginViewController viewDidAppear:] + 170
4 UIKit 0x0119e099 -[UIViewController _setViewAppearState:isAnimating:] + 526
5 UIKit 0x0119e617 -[UIViewController __viewDidAppear:] + 146
6 UIKit 0x011a0014 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
7 UIKit 0x0119e9aa -[UIViewController _executeAfterAppearanceBlock] + 63
8 UIKit 0x010990d0 ___afterCACommitHandler_block_invoke_2 + 33
9 UIKit 0x01099055 _applyBlockToCFArrayCopiedToStack + 403
10 UIKit 0x01098e9a _afterCACommitHandler + 568
11 CoreFoundation 0x0260436e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
12 CoreFoundation 0x026042bf __CFRunLoopDoObservers + 399
13 CoreFoundation 0x025e2254 __CFRunLoopRun + 1076
14 CoreFoundation 0x025e19d3 CFRunLoopRunSpecific + 467
15 CoreFoundation 0x025e17eb CFRunLoopRunInMode + 123
16 GraphicsServices 0x042205ee GSEventRunModal + 192
17 GraphicsServices 0x0422042b GSEventRun + 104
18 UIKit 0x0107bf9b UIApplicationMain + 1225
19 appname 0x00004e3d main + 141
20 libdyld.dylib 0x02ed9701 start + 1
21 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
However I do not think I am doing something wrong with my code this is my viewdiappear. What did I miss out so that this kind of error is created?
- (void)viewDidAppear:(BOOL)animated {
PFUser *user = [PFUser currentUser];
if (user.username != nil) {
[self performSegueWithIdentifier:#"login" sender:self];
}
}

It seems like you haven't set the name of the segue in the storyboard. The picture below is the name of one of my segues, for you, the text box would contain simply login.
It can also happen when you forget to "Embed" the storyboard in Navigation controller:

What the error is telling you is that although your storyboard may contain a segue called #"login", it does not emanate from this LoginViewController (the one that is currently self).
You may think it does, but trust me, the runtime knows more than you do.

Related

Swift: Not able to navigate to another view controller

I really do not know what mistake am I doing in the following lines:
// Instantiate SecondViewController
let secondViewController = self.storyboard?.instantiateViewController(withIdentifier: "RegistrationScreen2View") as! RegistrationScreen2ViewController
self.navigationController?.pushViewController(secondViewController, animated: true)
I am not able to move to second view controller in the story board I have mentioned story board id as RegistrationScreen2View for RegistrationScreen2ViewController.
I am getting the following exception:
2016-10-24 11:26:16.607 toadways[965:11142] -[toadways.RegistrationScreen1ViewController continue]: unrecognized selector sent to instance 0x7fe05dc34ec0
2016-10-24 11:26:16.619 toadways[965:11142] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[toadways.RegistrationScreen1ViewController continue]: unrecognized selector sent to instance 0x7fe05dc34ec0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010efa534b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010ea0621e objc_exception_throw + 48
2 CoreFoundation 0x000000010f014f34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010ef2ac15 ___forwarding___ + 1013
4 CoreFoundation 0x000000010ef2a798 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010f3cab88 -[UIApplication sendAction:to:from:forEvent:] + 83
6 UIKit 0x000000010f5502b2 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x000000010f5505cb -[UIControl _sendActionsForEvents:withEvent:] + 444
8 UIKit 0x000000010f54f4c7 -[UIControl touchesEnded:withEvent:] + 668
9 UIKit 0x000000010f4380d5 -[UIWindow _sendTouchesForEvent:] + 2747
10 UIKit 0x000000010f4397c3 -[UIWindow sendEvent:] + 4011
11 UIKit 0x000000010f3e6a33 -[UIApplication sendEvent:] + 371
12 UIKit 0x000000010fbd8b6d __dispatchPreprocessedEventFromEventQueue + 3248
13 UIKit 0x000000010fbd1817 __handleEventQueue + 4879
14 CoreFoundation 0x000000010ef4a311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
15 CoreFoundation 0x000000010ef2f59c __CFRunLoopDoSources0 + 556
16 CoreFoundation 0x000000010ef2ea86 __CFRunLoopRun + 918
17 CoreFoundation 0x000000010ef2e494 CFRunLoopRunSpecific + 420
18 GraphicsServices 0x0000000116c0ca6f GSEventRunModal + 161
19 UIKit 0x000000010f3c8f34 UIApplicationMain + 159
20 toadways 0x000000010e2318bf main + 111
21 libdyld.dylib 0x000000011266368d start + 1
22 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Please let me know what mistake am I doing.
Your code should work. The most possibility is that you forgot to input an Storyboard ID for your destination ViewController.
***How to Fix:
In the Identity Inspector of destination ViewController, enter its ID.

Uncaught exception 'NSInvalidArgumentException',reason: 'Receiver .. has no segue'

I just started recently. I can't fix it and I don't know How to do
I have attached files and images. When I run my app, I receive the following error:
2015-11-26 12:17:08.175 login[6107:324531]
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'Receiver (<login.ViewController: 0x7fc0d94b28d0>)
has no segue with identifier 'loginView''
*** First throw call stack:
(
0 CoreFoundation 0x0000000100457f45 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010217bdeb objc_exception_throw + 48
2 UIKit 0x0000000100e099ea -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0
3 login 0x000000010025fc85 _TFC5login14ViewController13viewDidAppearfS0_FSbT_ + 309
4 login 0x000000010025fce1 _TToFC5login14ViewController13viewDidAppearfS0_FSbT_ + 49
5 UIKit 0x0000000100e0c675 -[UIViewController _setViewAppearState:isAnimating:] + 830
6 UIKit 0x0000000100e0cff8 -[UIViewController _endAppearanceTransition:] + 262
7 UIKit 0x0000000100e47a00 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 1290
8 UIKit 0x0000000100e3d917 __49-[UINavigationController _startCustomTransition:]_block_invoke + 233
9 UIKit 0x000000010166db24 -[_UIViewControllerTransitionContext completeTransition:] + 101
10 UIKit 0x0000000100c5cf4a __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke93 + 834
11 UIKit 0x0000000100d1eace -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 644
12 UIKit 0x0000000100cfc9df -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 241
13 UIKit 0x0000000100cfcd8e -[UIViewAnimationState animationDidStop:finished:] + 80
14 QuartzCore 0x00000001051b9fa0 _ZN2CA5Layer23run_animation_callbacksEPv + 308
15 libdispatch.dylib 0x0000000102c4f49b _dispatch_client_callout + 8
16 libdispatch.dylib 0x0000000102c372af _dispatch_main_queue_callback_4CF + 1738
17 CoreFoundation 0x00000001003b82e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
18 CoreFoundation 0x00000001003798a9 __CFRunLoopRun + 2073
19 CoreFoundation 0x0000000100378e08 CFRunLoopRunSpecific + 488
20 GraphicsServices 0x0000000104a4bad2 GSEventRunModal + 161
21 UIKit 0x0000000100c7430d UIApplicationMain + 171
22 login 0x00000001002630dd main + 109
23 libdyld.dylib 0x0000000102c8392d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
My screenshots of code are here:
Screenshots of code
Your error tells you exactly what you need to do.
Receiver (<login.ViewController: 0x7fc0d94b28d0>) has no segue with identifier 'loginView'
so check your segue in storyboard and ensure that segue identifier from LoginViewController is loginView.

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

The log error is as follows
015-07-03 17:37:47.392 CoreData_Saha[4403:133938] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "jgh-55-9I5-view-Ywb-7c-HKv" nib but didn't get a UITableView.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ab4ff35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010a43fbb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010ab4fe6d +[NSException raise:format:] + 205
3 UIKit 0x000000010b21e415 -[UITableViewController loadView] + 249
4 UIKit 0x000000010b0617f9 -[UIViewController loadViewIfRequired] + 75
5 UIKit 0x000000010b061c8e -[UIViewController view] + 27
6 UIKit 0x000000010b099d3b -[UINavigationController preferredContentSize] + 149
7 UIKit 0x000000010b041ec2 -[UIPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 101
8 UIKit 0x000000010b03fb0d __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 108
9 UIKit 0x000000010af5f331 _applyBlockToCFArrayCopiedToStack + 314
10 UIKit 0x000000010af5f1ab _afterCACommitHandler + 516
11 CoreFoundation 0x000000010aa84dc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
12 CoreFoundation 0x000000010aa84d20 __CFRunLoopDoObservers + 368
13 CoreFoundation 0x000000010aa7ab53 __CFRunLoopRun + 1123
14 CoreFoundation 0x000000010aa7a486 CFRunLoopRunSpecific + 470
15 GraphicsServices 0x000000010e11e9f0 GSEventRunModal + 161
16 UIKit 0x000000010af3c420 UIApplicationMain + 1282
17 CoreData_Saha 0x0000000109f0de73 main + 115
18 libdyld.dylib 0x000000010d0df145 start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
"[UITableViewController loadView] loaded the "jgh-55-9I5-view-Ywb-7c-HKv" nib but didn't get a UITableView."
This is saying that somewhere in your storyboard there's a UITableViewController or a subclass of it which has its view property connected to something that is not a UITableView or subclass of that.
Check each view controller in the storyboard to make sure its view is connected to something appropriate.

segmented control - unrecognized selector sent to instance

I want to use sender to get the value from segmented control, but I am getting the unrecognized selector sent to instance error. The segmented control was added within a view. I've tried removing the semicolon and/or sender and none of the prior posts I've found seem to help. Any ideas?
Swift Code
var segCntrl = UISegmentedControl(items: ["Yes","No"])
segCntrl.tag = 100
segCntrl.center = CGPointMake(qView.bounds.width/2, qView.bounds.minY+40)
self.qView.addSubview(segCntrl)
func segmentorSwitch(sender: AnyObject) {
if(sender.selectedSegmentIndex == 1) {
println("Yes selected")
}
else if(sender.selectedSegmentIndex == 2) {
println("No selected")
}
}
segCntrl.addTarget(self, action: "segmentorSwitch:", forControlEvents: UIControlEvents.ValueChanged)
Error code:
2015-07-07 11:46:24.482 myApp [75641:1855377] -[[myApp.SegViewControllerr segmentorSwitch:]: unrecognized selector sent to instance 0x7fbb0a43b450
2015-07-07 11:46:24.489 myApp[75641:1855377] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[myApp.SegViewController segmentorSwitch:]: unrecognized selector sent to instance 0x7fbb0a43b450'
* First throw call stack:
(
0 CoreFoundation 0x00000001060dcc65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010838abb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001060e40ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010603a13c ___forwarding_ + 988
4 CoreFoundation 0x0000000106039cd8 _CF_forwarding_prep_0 + 120
5 UIKit 0x00000001070bfd62 -[UIApplication sendAction:to:from:forEvent:] + 75
6 UIKit 0x00000001071d150a -[UIControl _sendActionsForEvents:withEvent:] + 467
7 UIKit 0x000000010724dfba -[UISegmentedControl _setSelectedSegmentIndex:notify:animate:] + 570
8 UIKit 0x000000010724ffbf -[UISegmentedControl touchesEnded:withEvent:] + 143
9 UIKit 0x000000010710c958 -[UIWindow _sendTouchesForEvent:] + 735
10 UIKit 0x000000010710d282 -[UIWindow sendEvent:] + 682
11 UIKit 0x00000001070d3541 -[UIApplication sendEvent:] + 246
12 UIKit 0x00000001070e0cdc _UIApplicationHandleEventFromQueueEvent + 18265
13 UIKit 0x00000001070bb59c _UIApplicationHandleEventQueue + 2066
14 CoreFoundation 0x0000000106010431 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
15 CoreFoundation 0x00000001060062fd __CFRunLoopDoSources0 + 269
16 CoreFoundation 0x0000000106005934 __CFRunLoopRun + 868
17 CoreFoundation 0x0000000106005366 CFRunLoopRunSpecific + 470
18 GraphicsServices 0x000000010cc5ba3e GSEventRunModal + 161
19 UIKit 0x00000001070be8c0 UIApplicationMain + 1282
20 myApp 0x0000000104d9a0c7 main + 135
21 libdyld.dylib 0x0000000109458145 start + 1
22 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Looks like segmentorSwitch: is implemented inside another method. Define it outside the method in which your code is contained, and this should be fixed.

Xcode/IOS debugging

I am a total newbie with objective C and IOS programming trying to follow along with a tutorial on the Apple Website.
I got to the point in the Apple tutorial where you add an unwind segue to the Add to-do page.
https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html#//apple_ref/doc/uid/TP40011343-CH8-SW1
I successfully added unwind segues to both the Cancel and Done buttons.
However, when I compiled the program, while it compiles, it no longer lets me click on + to get to the add to-do page.
When the simulator initially loads, it is fine. But when I click on +, Xcode appears in front of the simulator and in the debugger it says what is below.
Note I have no experience in debugging. What appears in editor is main.m and the following is in right side of debug section at bottom:
2014-12-03 13:28:54.854 single-nocore[20692:1523451] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "vXZ-lx-hvc-view-kh9-bI-dsS" nib but didn't get a UITableView.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000102eabf35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101265bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000102eabe6d +[NSException raise:format:] + 205
3 UIKit 0x0000000101785415 -[UITableViewController loadView] + 249
4 UIKit 0x00000001015c87f9 -[UIViewController loadViewIfRequired] + 75
5 UIKit 0x00000001015c8c8e -[UIViewController view] + 27
6 UIKit 0x0000000101600d3b -[UINavigationController preferredContentSize] + 149
7 UIKit 0x00000001015a8ec2 -[UIPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 101
8 UIKit 0x00000001015a6b0d __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 108
9 UIKit 0x00000001014c6331 _applyBlockToCFArrayCopiedToStack + 314
10 UIKit 0x00000001014c61ab _afterCACommitHandler + 516
11 CoreFoundation 0x0000000102de0dc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
12 CoreFoundation 0x0000000102de0d20 __CFRunLoopDoObservers + 368
13 CoreFoundation 0x0000000102dd6b53 __CFRunLoopRun + 1123
14 CoreFoundation 0x0000000102dd6486 CFRunLoopRunSpecific + 470
15 GraphicsServices 0x0000000104bae9f0 GSEventRunModal + 161
16 UIKit 0x00000001014a3420 UIApplicationMain + 1282
17 single-nocore 0x0000000100d39b23 main + 115
18 libdyld.dylib 0x0000000103b5c145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Thanks in advance for any suggestions.

Resources