Problem with views and view controllers on iOS..

Discussion in 'Game Development (Technical)' started by Jamie W, May 7, 2012.

  1. Jamie W

    Original Member Indie Author

    Joined:
    Apr 16, 2006
    Messages:
    1,211
    Likes Received:
    0
    Hello,

    My game is running in landscape mode; my main view controller for shouldAutorotateToInterfaceOrientation, returns YES for UIInterfaceOrientationLandscapeRight and UIInterfaceOrientationLandscapeLeft, NO for anything else.

    Everything seems to work fine, until...

    I show game a center leaderboard. The leaderboard comes on okay (in landscape mode), but after it gets dismissed, the orientation of my game somehow gets switched to portrait. I can tilt the device and the view rotates back in to landscape, and then will not go in to portrait again (unless I display the learderboard again).

    A bit miffed!

    Any help or suggestions would be appreciated..

    Thanks,
    Jamie.
     
  2. Jamie W

    Original Member Indie Author

    Joined:
    Apr 16, 2006
    Messages:
    1,211
    Likes Received:
    0
    Solved it. I was only attaching the view (of the game center view controller) in to the view hierarchy. Turns out I needed to attach the view controller itself.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer