SWRevealViewController icon indicating copy to clipboard operation
SWRevealViewController copied to clipboard

Xcode breaks on performSegueWithIdentifier:sender:

Open jpcguy89 opened this issue 7 years ago • 17 comments

SWRevealViewController works amazingly. I just have one minor irritation I would like to see fixed. Every time I run my app, if I have breakpoints enabled it always breaks twice on line 1713 in SWRevealViewController.m

[self performSegueWithIdentifier:SWSegueRightIdentifier sender:nil];

It's not a fatal error, and I'm not sure why Xcode is throwing an exception, but it is.

Thanks!

jpcguy89 avatar Aug 26 '17 15:08 jpcguy89

I think you have to clear the project (Menu: Product->Clean and Alt+Product->Clean Build Folder...)

iDevelopper avatar Aug 26 '17 15:08 iDevelopper

Nope. Followed the exact instructions. Still breaks there.

jpcguy89 avatar Aug 26 '17 15:08 jpcguy89

breakpointswrevealviewcontroller

jpcguy89 avatar Aug 26 '17 15:08 jpcguy89

Verify the segue identifier in the storyboard. It should be sw_front or sw_rear or sw_right

iDevelopper avatar Aug 26 '17 16:08 iDevelopper

Clarification: You're saying all segues that are going from the "side menu" should have "sw_right" as the segue identifier?

I have "sw_rear" set for the side menu, and "sw_right" set for the initial view controller. The rest have their own unique identifiers.

jpcguy89 avatar Aug 29 '17 16:08 jpcguy89

You must have a sw_front segue for the front view controller. sw_rear is for the left side controller. sw_right for the right side controller.

iDevelopper avatar Aug 30 '17 04:08 iDevelopper

I apologize, I misspoke. The segue to the initial controller is, in fact, sw_front, not sw_right.

jpcguy89 avatar Aug 30 '17 13:08 jpcguy89

And then? Always the issue? If so, could you upload a project?

iDevelopper avatar Aug 30 '17 13:08 iDevelopper

Every time. I wouldn't feel comfortable posting the project publicly. I know that's not helpful, but I've been working on this for years and can't even fathom if someone were to publish an app using the code I've written.

jpcguy89 avatar Aug 30 '17 14:08 jpcguy89

Ok, but perhaps can you reproduce the same issue in a sample project?

iDevelopper avatar Aug 30 '17 15:08 iDevelopper

Yep, was able to reproduce the issue with a new test project. Added a breakpoint to break on all exceptions, ran, and sure enough, it hit that same line of code. RevealViewControllerTest.zip

jpcguy89 avatar Aug 30 '17 16:08 jpcguy89

Added a sw_front set segue to the blue view controller:

RevealViewControllerTest.zip

iDevelopper avatar Aug 31 '17 05:08 iDevelopper

Any news on this? I believe the issue was still there after you added the segue.

jpcguy89 avatar Sep 06 '17 15:09 jpcguy89

No, I do not have this issue!

iDevelopper avatar Sep 06 '17 17:09 iDevelopper

And you added a breakpoint for all obj-c and C++ exceptions?

jpcguy89 avatar Sep 06 '17 17:09 jpcguy89

No, why do you want to add a breakpoint?

iDevelopper avatar Sep 06 '17 17:09 iDevelopper

Ok I see, I added a breakpoint. It is normal because there is no segue with identifier sw_right in the application. But the exception is not thrown. So, no crash...

There is no documented method in Apple Documentation to check if a segue exist, so the author used a workaround!

iDevelopper avatar Sep 07 '17 05:09 iDevelopper