所以我有一个对象require(quantmod)
library(chron)
library(caTools)
## rm(list = ls())
# Get the data
from.dat <- as.Date("2015-01-01")
#to.dat <- as.Date("2000-01-01")
ES <- getSymbols("^GSPC" , from = from.dat,auto.assign = FALSE) # to today
data <- ES
rm(ES)
data<-data[,6]
names(data)<-c("ES")
# create vectore with dummy values
data$num <- rep(10,length(data$ES))
for(i in 2:length(data$num)){
if (data$num[i-1] == 10) {data$num[i] <- 5}
}
# moving average with moving length
data$sma<-SMA(data$ES, data$num )
plot(data$ema)
,我将该对象转换为该对象的子类。
UIView *_baseView
这就是GPUImageView类的样子:
GPUImageView *filterView = (GPUImageView *)_baseView;
这就是GPUImageInput Class的样子:
@interface GPUImageView : UIView <GPUImageInput>
{
GPUImageRotationMode inputRotation;
}
现在,当我致电@protocol GPUImageInput <NSObject>
- (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex;
- (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex;
- (NSInteger)nextAvailableTextureIndex;
- (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex;
- (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex;
- (CGSize)maximumOutputSize;
- (void)endProcessing;
- (BOOL)shouldIgnoreUpdatesToThisTarget;
- (BOOL)enabled;
- (BOOL)wantsMonochromeInput;
- (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue;
@end
时,我收到了错误消息:
[filterView nextAvailableTextureIndex];
我知道_baseView不是GPUImageView而且没有选择器,但这就是在似乎构建正常的示例应用程序中完成它的方式。演员在某些情况下是否有效而在其他情况下是否有效?