Reputation: 669
I have a class that inherits from UIViewController:
public class A : UIViewController {
public A():base("A",null){
//implementation
}
//Also it has the ViewDidLoad() and DidReceiveMemoryWarning(), etc.
}
Now i have a class B inheriting from A:
public class B : A {
public A():base(){
//implementation
}
//Also it has the ViewDidLoad() and DidReceiveMemoryWarning(), etc.
}
Then i create a B class instance:
B b = new b();
But when the screen appears, it throws
"Failed to find selector setCancelButton: on iOS.B"
So the question is: how can i access items on a class inheriting from UIViewController (item in .xib) from a child class?
Upvotes: 0
Views: 827
Reputation: 5969
You have to put an Attribute on each class registering them on Objective-C:
[Register("A")]
public class A : UIViewController { }
[Register("B")]
public class B : A { }
Upvotes: 1