0
votes

i am trying to pass some data while doing a segue, but am getting the error

Chat System[2501:974283] -[UIViewController setVisitid:]: unrecognized selector sent to instance 0x17e22a10 Chat System[2501:974283]


Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController setVisitid:]: unrecognized selector sent to instance 0x17e22a10'

Here is my code

- (void) goToTransferChat {

        TransferChat *dvc2 = [self.storyboard instantiateViewControllerWithIdentifier:@"id_chat_transfer"];
        [dvc2 setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
        dvc2.visitid = self.visitorID;
        dvc2.visitame = self.visitorName;
        dvc2.visitStartTime = self.visitorStartTime;
        [self presentViewController:dvc2 animated:YES completion:nil];

}

TransferChat

#import <UIKit/UIKit.h>

@interface TransferChat : UIViewController

@property(strong, nonatomic) NSString *visitid;
@property(strong, nonatomic) NSString *visitame;
@property(strong, nonatomic) NSString *visitStartTime;



- (void) getAllOperators:(NSString *) profileToken;
- (void)setupProfileidURL:(NSString *)profileId companyId:(NSString *) companyID;


@end
1
dvc2.visitid = self.visitorID; in that piece of code is dvc2.visitid String? And make sure you have @Synthesize the property in TransferChat.mPiyush
Are you sure the visitid you are passing is NSString.Sunny
Did you check the [dvc2 class]. Does it return TransferChat?nynohu
yes everything is a stringSathya Baman

1 Answers

0
votes

You have to set class to your storyboard controller like below:

enter image description here

Try to set Custom call here