1
好日子,溯造型一类无需添加一个新的构造
我试图创建由ApiDefinitions.cs(MonoTouch的)
[BaseType (typeof(UIView))]
interface GPUImageView : GPUImageInput{
[Export ("initWithFrame:")]
IntPtr Constructor(RectangleF frame);
[Export ("autoresizingMask")]
UIViewAutoresizing AutoResizingMask { get; set;}
[Export ("addSubView:")]
void AddSubView(UIView view);
}
写这个的(的ObjectiveC)
@interface GPUImageView : UIView <GPUImageInput>
{
GPUImageRotationMode inputRotation;
}
绑定
,我得到一个 “InvalidCastException的” 当我打电话
GPUImage.GPUImageView filterView = (GPUImage.GPUImageView)this.View;
我可以创建一个使用反射的构造函数。但是,它真的是正确的做法吗?
干杯!
'this.View'是如何创建的? –
这是我的viewController中的标准视图。 – Bagaboo
如果您使用Interface Builder,则需要将Interface Builder中的视图类型更改为GPUImageView。 –