Ios 使用segue传递字符串会导致崩溃

Ios 使用segue传递字符串会导致崩溃,ios,objective-c,segue,Ios,Objective C,Segue,我正在尝试将字符串从ViewController(VC)传递到CollectionViewController(CVC) 我在VC上有一个ui按钮,触发的show序列链接到CVC。 在我的VC中,我有如下prepareForSegue - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"gotoImages&q

我正在尝试将字符串从
ViewController(VC)
传递到
CollectionViewController(CVC)
我在VC上有一个
ui按钮
,触发的
show
序列链接到CVC。 在我的VC中,我有如下
prepareForSegue

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

@interface CQTaskPhotosCVC : UICollectionViewController
@property (nonatomic, strong) NSString *queueID;
@end
这是我得到的错误

2016-02-02 12:05:45.015仙人掌队列[41739:6063627]-[UICollectionViewController setQueueID:]:发送到实例0x12836e410的选择器无法识别

2016-02-02 12:05:45.017 CactusQueue[41739:6063627]***由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:'-[UICollectionViewController setQueueID::::]:未识别的选择器发送到实例0x12836e410'

我以前使用segues在VC之间传递数据,但我从未遇到过这个问题。删除
vc.queueiD=\u idCode不会导致崩溃,所以我不知道我是否忽略了一些愚蠢的事情。

怎么办?

如果您在“自定义类”部分输入了CQTaskPhotosCVC作为类,请在界面生成器的右侧进行检查:

您的错误:

[UICollectionViewController setQueueID:]: unrecognized selector sent to instance 
它表示类
UICollectionViewController
的对象正在调用它不知道的方法
setQueueID:


因此,您真正的问题是,在情节提要中,您没有将自定义类
CQTaskPhotosCVC
设置为
UICollectionViewController

,您确定在InterfaceBuilder的情节提要中将
UIViewController
的正确类设置为
CQTaskPhotosCVC
?确实如此。天哪,我需要一些咖啡。。。。或者睡觉。谢谢larme指出,这就是问题所在。这就是为什么你不用睡眠不足来编码。