将复杂的double值从ViewController传递到另一个ViewController

时间:2015-10-29 14:13:25

标签: ios objective-c uiviewcontroller

我需要将复杂的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

0 个答案:

没有答案