0
votes

I'm trying to pass a string from a ViewController (VC) to a CollectionViewController (CVC) I have a UIButton on VC with a triggered segue of show linked to the CVC. In my VC, i have prepareForSegue as follows

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"gotoImages"]) {
        CQTaskPhotosCVC *vc = segue.destinationViewController;
        vc.queueID = _idCode;
    }
} 

in my CVC.h

@interface CQTaskPhotosCVC : UICollectionViewController
@property (nonatomic, strong) NSString *queueID;
@end

and heres the error i get

2016-02-02 12:05:45.015 CactusQueue[41739:6063627] -[UICollectionViewController setQueueID:]: unrecognized selector sent to instance 0x12836e410

2016-02-02 12:05:45.017 CactusQueue[41739:6063627] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICollectionViewController setQueueID:]: unrecognized selector sent to instance 0x12836e410'

I've passed data between VC using segues before and I've never come across this issue. removing vc.queueiD = _idCode; doesn't result in a crash so i don't know if I'm just overlooking something stupid or what. what do?

2
Are you sure you set in your Storyboard in InterfaceBuilder the correct class to your UIViewController to CQTaskPhotosCVC?Larme
that was is. god i need some coffee.... or sleep. thankslizzy81

2 Answers

0
votes

Your error:

[UICollectionViewController setQueueID:]: unrecognized selector sent to instance 

It says that a object of class UICollectionViewController is calling a method setQueueID: that it doesn't know.

So, your real issue is that in your Storyboard, you didn't set the custom class CQTaskPhotosCVC to the UICollectionViewController.

0
votes

Check at the right side in interface builder, if you have entered CQTaskPhotosCVC as class in the custom class section:

enter image description here