Discussion Forums  >  Uncategorized

Replies: 1    Views: 221

chadh0130
Apple Fan
Profile
Posts: 352
Reg: Nov 05, 2011
Rhode Island
4,020
01/13/12 03:23 AM (14 years ago)

Message meant for David@Buzztouch-Subclassing in Xcode

Hey David- I'm sort of new to developing apps. I was doing some google research and came across a topic of over-riding methods by subclassing a file. Essentially I have an issue where I locked my app in portrait mode due to menu button but within my app, I have youtube videos pulling from RSS feeds. Since my app is locked in portrait, my videos are forced to play in portrait. I was reading that if I over ride the method by subclassing the MPMoviePlayerViewController with the ShouldAutoRotateToInterface method then I can get the videos to play in landscape. But this might be a stupid question, How do we subclass a file in the source code that we download from Buzztouch? I've done about 6 hours worth of research on subclassing and all the posts I've read and videos watched...I can't seem to find a Classes>Subclass button let alone dropdown option within my xcode. I've been scratching my head for days trying to figure out how to play my videos in landscape mode and haven't came up with any solution.. So if at all possible, I give you guys access to download my project if you want to take a look and maybe help me figure something out? or simply explain how I can subclass a file? btw I'm working with v1.5 on iOS if that helps :/
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/13/12 09:33 AM (14 years ago)
hi in Baltimore, Subclassing is not appropriate for all situations, probably not this one either. However, I'm glad to hear you've been doing some digging. If you're trying to get the MPMoviePlayerViewController to play in landscape, and portrait, then the UIViewController that launches it will need to rotate. In other words, which 'screen' is the app on when the player displays. This may be tough to get your head around. Onwards, the BT_viewControllerManager.m file is the file that actually presents the movie player. This files is a sort of utility file that handles all sorts of methods. Lets say you're looking at a Menu List with a Play Video choice. The menu list is the 'parent' UIViewController that needs to rotate in order for the video to rotate. Knowing this, it's logical that figuring out how to rotate the Menu will also allow the video to rotate. Allowing the menu to rotate is controlled by the menu's parent class - BT_rotatingNavController or the BT_rotatingTabBarController (or both, depending on whether or not your app is using tabs or not). All the screens types in your project are UIViewController classes that are sub-classes of the BT_viewController. Confused yet? Bottom line is this, don't worry about subclassing until you understand what's rotating and what's not rotating so you can control than. I would start by having a look at all the rotating methods in the BT_rotatingNavController and the BT_rotatingTabBarController files so you can determine which method are or are not firing. These are in the BT_Layout folder in your Xcode project.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.