The parentViewController property of UIViewController is readonly, but I am nesting custom view controllers and would like to use this property.
However, since it is re
However, since it is readonly, and I found no other way to set this property, my quesion is: how do I set it?
If it is readonly
, you can't use dot notation without getting a compiler error.
However, you might be able to use categories to add a custom modifyParentViewController
method to the UIViewController
class.
Even if the property is readonly, the variable itself might be modifiable, if it is not @protected
. If it is @protected
, subclassing the view controller may allow you the option of modifying the variable.