Will Apple reject an application to use KVC to install parentViewController on a UIViewController?

I implement custom subclasses UIViewControllerthat emulate UITabBarControllerand behavior UINavigationController.

I would like to make these classes generic enough for anyone to use UIViewController. One of the problems that I have encountered is that the property parentViewController(and also navigationController) is read-only.

(In addition, one installation motivation parentViewControlleris for the correct behavior -presentMoviePlayerViewControllerAnimated:. The UIViewController seems to pass it to the parentViewController if installed.)

Using the KVC method setValue:self forKey:@"parentViewController"seems to work, but can it reject my application? Has anyone done something like this?

+3
source share
2 answers

I would not worry about the rejection, but I would worry about any motivation Apple did to create the parentViewController to read only for a start. They may be dependent on this, and you can introduce a subtle error.

For example, if it is not equal to zero at the time of its installation, who calls the release at the previous value. Can these properties be transferred elsewhere (and saved) before overwriting them?

If you are sure that you are not introducing a subtle mistake, then everything should be fine. Check for iOS updates on time to make sure everything hasn't changed.

0
source

I can’t speak for this exact situation, but from what I know and have heard, I don’t think this should be a problem.

0

All Articles