我正在尝试使用prepareForSegue方法在另一个 VC 上设置一个整数。我有四个按钮,每个按钮在按下时都有自己的布尔值
- (IBAction)answerChoiceFourPressed:(id)sender {
    self.ButtonFourPressed = YES;
}
我在这里有这个方法:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    ((SecondQuestionViewController *)segue.destinationViewController).delegate=self;
    if ([segue.identifier isEqualToString:@"toQuestion2"]) {
        SecondQuestionViewController *mdvc = segue.destinationViewController;
        NSInteger newInt;
        if (ButtonTwoPressed == YES) {
            newInt = 1;
            [mdvc setSecondScore:newInt];}
        if (ButtonThreePressed == YES) {
            newInt = 2;
            [mdvc setSecondScore:newInt];}
        if (ButtonFourPressed == YES) {
            newInt = 3;
            [mdvc setSecondScore:newInt];} 
        else {
            [mdvc setSecondScore:0];}
    }
}
在 SecondQuestionViewController 中,我已经涵盖了所有内容:
#import "FirstQuestionViewController.h"
并且 secondScore int 被声明为@property:
@property (nonatomic, assign) NSInteger secondScore;
我正在使用 NSLog(@"Score NUMBER 2 is %d", secondScore);
它总是给我0,除非按下第四个按钮:它给我3(prepareForSegue方法中的最后一个)可能的问题是什么?提前致谢!