Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Segue when using the PTDSimpleCalendarViewController #78

Open
artangco opened this issue Sep 24, 2015 · 1 comment
Open

Issue with Segue when using the PTDSimpleCalendarViewController #78

artangco opened this issue Sep 24, 2015 · 1 comment

Comments

@artangco
Copy link

Basically the segue doesn't work. It says it couldn't find that Segue for this view controller. I have tried the same exact code for viewcontroller and the segue is found. The only difference is when I inherit from PTDSimpleCalendarViewController the segue is not found. If there is another way to do this please advise. Basically when a date is clicked I'd like to perform a segue.

//
// Calendar.h
// SuperMe
//
// Created by Saviz Artang on 9/18/15.
// Copyright (c) 2015 com.artangco. All rights reserved.
//

import "PDTSimpleCalendarViewController.h"

@interface CalendarViewController : PDTSimpleCalendarViewController

@Property (nonatomic, strong) NSDate * myselectedDate;

@EnD

//
// Calendar.m
// SuperMe
//
// Created by Saviz Artang on 9/18/15.
// Copyright (c) 2015 com.artangco. All rights reserved.
//

import "CalendarViewController.h"

import "SMTableViewController.h"

@implementation CalendarViewController

-(void) viewDidLoad
{
[super viewDidLoad];

self.delegate = self;

}

  • (void)simpleCalendarViewController:(PDTSimpleCalendarViewController *)controller didSelectDate:(NSDate *) date
    {
    self.myselectedDate = date;
    [self performSegueWithIdentifier:@"ctv" sender:self];
    }

  • (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    SMTableViewController * trackingTableView ;

    trackingTableView = [segue destinationViewController];
    trackingTableView.day = self.myselectedDate;
    }

@EnD

@SimonRice
Copy link

I found the same issue - it looks like it's something to do with PDTSimpleCalendarViewController's initWithCoder: not calling [super initWithCoder:].

I worked around this by calling self = [super initWithCoder:coder]; before self = [super initWithCollectionViewLayout:[[PDTSimpleCalendarViewFlowLayout alloc] init]]; - it really isn't a nice hack & I'm open to better ways around this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants