iOS应用程序演练出现在比预期更多的ViewControllers中

时间:2014-11-20 04:49:31

标签: ios objective-c segue

我目前正在实施WSCoachMarksView框架,以便在首次使用该应用时向用户介绍功能。下面的代码在我的SearchViewController.m中,并为该视图控制器做了它应该做的事情。

然而,当从这个视频转换到另一个视图控制器时,它将再次运行WSCoachMarksView代码并使屏幕变暗,尽管目标视图控制器中没有代码告诉它这样做。为什么会这样?以下代码中是否有某些内容不包含仅SearchViewController的操作?我应该补充一点,SearchViewController位于导航视图中。

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Setup coach marks
    NSArray *coachMarks = @[
                            @{
                                @"rect": [NSValue valueWithCGRect:(CGRect){{50,168},{220,45}}],
                                @"caption": @"Just browsing? We'll only notify you periodically of new matches. Need it soon? We'll notify you more frequently, and match you with items that are closer to you."
                                },
                            ];

    WSCoachMarksView *coachMarksView = [[WSCoachMarksView alloc] initWithFrame:self.view.bounds coachMarks:coachMarks];
    [self.view addSubview:coachMarksView];
    coachMarksView.animationDuration = 0.5f;
    coachMarksView.enableContinueLabel = YES;
    [coachMarksView start];
}

0 个答案:

没有答案
相关问题