1
votes

I've assigned a custom view class for a View Controller in Interface Builder. The referencing outlet in the View Controller for the "view" is a valid "CustomView", and the view object in Interface Builder has been assigned a custom class of "CustomView". However, when I try to reference specific properties of "CustomView" in my View Controller, through its "view" property, I get errors. I think its because it still believes its a UIView class, and not my "CustomView" class.

Is there a way to update the View Controller's class definition of its "view"?

1

1 Answers

1
votes

If you're sure you have a CustomView object linked to 'view' use a cast to give the compiler a hint, like:

[(CustomView *)view doSomething];

or

((CustomView *)view).stringProperty = @"Hello";

If you want it to be safe, check that view really is a member of the CustomView class before making the call.