views:

92

answers:

1

In iOS4, I want to use MPMoviePlayerController. I have a UIViewController that I pass to a custom class that manages MPMoviePlayerController. That plays video fine.

I have another view that is a UITableViewController. Passing the UITableViewController to my UIViewController property on the video class doesn't work. I just get sound. I'm fairly sure this is because the UITableViewController needs to be a UIViewController. I can change the UITableViewController to a UIViewController but this is a fairly good rewrite. Is there a way to access the parent UIViewController behind the UITableViewController?

I have also tried

(UIViewController*)self;

but that doesn't work either. I just get sound again.

+1  A: 

You can use `self.parentViewController. From the documentation:

Parent view controllers are relevant in navigation, tab bar, and modal view controller hierarchies. In each of these hierarchies, the parent is the object responsible for displaying the current view controller. If you are using a view controller as a standalone object—that is, not as part of a view controller hierarchy—the value in this property is nil.

Felixyz
This video stays in portrait, where as my pure UIViewController does rotate into landscape. Could this be related to the UITableViewController?
4thSpace
@4thSpace: I'm not sure how this is related to your original question. Maybe you should post a new question with more specific info?
Felixyz