我有一个具有类方法“getSimulatedPricesFrom”的类。它将在执行期间从同一类调用方法“projectFromPrice”。但是在 sTPlus1 行中,我遇到了 2 个错误:
1) Class method "projectFromPrice" not found
2) Pointer cannot be cast to type "double"
有谁知道为什么?我已经在 .h 文件中声明了该方法 下面是 AmericanOption.m 文件中编码的一部分:
#import "AmericanOption.h"
@implementation AmericanOption
+(NSMutableArray*)getSimulatedPricesFrom:(double)s0 withRate:(double)r0 withVol:(double)v0 withDays:(int)D withPaths:(int)N
{
double daysPerYr = 365.0;
double sT;
double sTPlus1;
sT = s0;
...
sTPlus1 = (double)[AmericanOption projectFromPrice:sT, r0/daysPerYr, v0/daysPerYr, 1/daysPerYr];
...
return arrPricePaths;
}
+(double)projectFromPrice:(double)s0 withRate:(double)r0 withVol:(double)v0 withDt:(double)dt
{
...
}