클래스 메서드 "getSimulatedPricesFrom"이 있습니다. 실행 중에 동일한 클래스에서 "projectFromPrice"메서드를 호출합니다. 그러나 라인 sTPlus1 라인에서 나는 2 개의 오류가 발생합니다 :동일한 클래스의 메서드로 클래스 메서드를 사용하는 중 Xcode 오류가 발생했습니다.
1) Class method "projectFromPrice" not found
2) Pointer cannot be cast to type "double"
아무도 이유에 대해 알고 있습니까? 난 이미 다음 AmericanOption.m 파일의 코드의 일부입니다 .H 파일 의 방법을 선언 한 :
sTPlus1 = [AmericanOption projectFromPrice:sT
withRate:r0/daysPerYr
withVol:v0/daysPerYr
withDt:1/daysPerYr];
에서 다음과 같이 당신이 projectFromPrice 메서드를 호출해야합니다 같은
#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 ... 감사합니다. 이제 작동합니다! –