在准备segue时尝试在公共属性中设置字符串时出现以下错误。任何想法为什么?在prepareForSegue中设置属性时出错:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController setQuestionObjectId:]: unrecognized selector sent to instance 0x7fa713562b40'
的代码是:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"postSegue"]) {
CommentsViewControllerNew *commentsVC = (CommentsViewControllerNew *)[segue destinationViewController];
commentsVC.hidesBottomBarWhenPushed = YES;
PFObject * question=[self.brightenArray objectAtIndex:self.indexPathOfClickedpost.row];
commentsVC.questionObjectId=question.objectId;
NSLog(@"%@",[self.Array objectAtIndex:self.indexPathOfClickedpost.row]);
// commentsVC.question = question;
请显示您的'CommentsViewControllerNew'代码,以便我们可以看到您的@property的问题。 –