我有一個類的類方法「getSimulatedPricesFrom」。它將在執行過程中從同一個類中調用方法「projectFromPrice」。然而,在行sTPlus1線,我遇到了2個錯誤:使用類方法通過相同類的方法的Xcode錯誤
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
{
...
}
O..ic ...謝謝。它現在有效! – 2012-04-25 12:38:05