4thSpace
4thSpace

Reputation: 44352

How to view value of segue.identifier in debugger?

I have a breakpoint on the if line below. This code is in ViewControllerOne. The push is to ViewControllerTwo. Once the breakpoint is hit, how do I view the value of segue.identifier without using an NSLog?

When I hover over identifier, nothing pops up. Hovering over seque just displays an NSObject in the debugger.

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if([segue.identifier isEqualToString:@"submitButtonToSeque"]) {
        AAViewControllerTwo *destinationViewController = segue.destinationViewController;
    }
}

Using an NSLog I can see the value output into the debugger. But I'd like to avoid the NSLog.

Upvotes: 0

Views: 184

Answers (2)

meda
meda

Reputation: 45500

Set a breakpoint on the if statement

enter image description here

As you type in the console, intellisense will help you autocomplete:

enter image description here

the command is po <object>:

enter image description here

Upvotes: 1

Larme
Larme

Reputation: 26076

Show the Debugger (XCode>View/Debug Area).
Show the Variables View (on the debug area, at the bottom right, click on the icon to show the left panel).
Once your code hits the breakpoint, right click on the segue var, print description

Upvotes: 0

Related Questions