我需要将复杂的double值从ViewController传递给另一个ViewController。 XCODE提示我这个错误“从不兼容的类型'分配给NSString'复数'”
ViewController.m
complex double A=0+0*I;
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([segue.identifier isEqualToString:@"Calculate"]){
[self ComputeABCD];
ResultViewController *controller = (ResultViewController *)segue.destinationViewController;
controller.textContent = cascadedA;
}
}
ResultViewController.m
@implementation ResultViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.result.text = self.textContent;
}
ResultViewController.h
@interface ResultViewController : UIViewController
@property (strong, nonatomic) IBOutlet UILabel *result;
@property (nonatomic, assign) complex double textContent;
@property (nonatomic, assign) complex double textValue;
@end