c# - Downcasting a class without adding a new constructor -


good day,

i trying create binding (objectivec)

@interface gpuimageview : uiview <gpuimageinput> {     gpuimagerotationmode inputrotation; } 

by writing in 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); } 

and "invalidcastexception" when call

gpuimage.gpuimageview filterview = (gpuimage.gpuimageview)this.view; 

i create constructor uses reflection. right way it?

cheers!

the solution was, rolf bjarne kvinge pointed out, change class type in interface builder gpuimageview. creates class should inherit gpimageview in turn inherits uiview. no need bind addsubview either.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -