在準備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的問題。 –