Bug 22899 - Missing iOS GetSupportedInterfaceOrientations
Summary: Missing iOS GetSupportedInterfaceOrientations
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.0.0
Hardware: Macintosh Mac OS
: High critical
Target Milestone: 8.0.0 (iOS 8)
Assignee: Bugzilla
Depends on:
Reported: 2014-09-11 22:08 UTC by Ian
Modified: 2014-09-17 12:30 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Ian 2014-09-11 22:08:09 UTC
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations () { return UIInterfaceOrientationMask.All; }

When I try to compile this (working code in iOS 7) in Xamarin for iOS 8 it errors out saying GetSupportedInterfaceOrientations() is not a method
Comment 1 Sebastien Pouliot 2014-09-12 00:05:51 UTC
UIViewController still define this virtual method.

Can you give us some sample code so we can see which type you're subclassing ?
Comment 2 Ian 2014-09-12 01:10:03 UTC
public class MainSplitViewController: UISplitViewController

That's the class the code is in
Comment 3 Sebastien Pouliot 2014-09-12 09:12:29 UTC
/Developer/MonoTouch/Source/monotouch/tests/monotouch-test/UIKit/SplitViewControllerTest.cs(51,46): error CS0505: `MonoTouchFixtures.UIKit.SplitViewControllerPoker.GetSupportedInterfaceOrientations()': cannot override because `MonoTouch.UIKit.UISplitViewController.GetSupportedInterfaceOrientations' is not a method
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1/monotouch.dll (Location of the symbol related to previous error)

This happens because:

public System.Func<UISplitViewController,MonoTouch.UIKit.UIInterfaceOrientationMask> GetSupportedInterfaceOrientations { get; set; }

was added (a property with the same name) in 8.0.

note: we'll need to teach the generator not to allow this
Comment 4 Sebastien Pouliot 2014-09-12 09:24:41 UTC
@Ian you can workaround this using:

	using (UISplitViewController svc = new UISplitViewController ()) {
		svc.GetSupportedInterfaceOrientations = (UISplitViewController) => UIInterfaceOrientationMask.All;

which is another (newer) way to control this using the *Delegate.

@Miguel this is still a breaking change (for any binaries). Maybe we should back this out before stable ? (and re-introduce it later, once corrected)
Comment 5 Sebastien Pouliot 2014-09-12 10:59:34 UTC
Miguel pushed a fix in master and backported it to monotouch-8.0.0-branch f214120dfd56535e76462749eee1cf1abb6687c5

Please verify this (or a later) build.
Comment 6 Ian 2014-09-12 12:41:30 UTC
Great, I'll wait for the next Beta bits.
Comment 7 GouriKumari 2014-09-17 10:53:16 UTC
Xamarin.iOS Preview Release : Xamarin.iOS, Version: (Enterprise Edition) , Hash: b26679f has this fix included. 

@Ian : With the latest preview release of Xamarin.iOS 8, could you  confirm that issue reported is fixed?
Comment 8 Ram Chandra 2014-09-17 11:52:09 UTC
I have checked this issue and I am able to reproduce this issue with X.iOS:

Screencast: http://www.screencast.com/t/0GW5knt6x5K2

To verify this issue, I have checked this issue with following builds:

Mac OS X 10.9.3
Xamarin Studio: 5.4 (build 239)
Xamarin.iOS (Business Edition)
Mono 3.8.0 ((no/45d0ba1)
Xcode 6.0 (6194.24)
Build 6A216f

=== Build Information ===
Release ID: 504000239
Git revision: 338110385bb89c5774e89ffcb15d8f2039e7fbcd
Build date: 2014-09-16 12:25:53-04
Xamarin addins: 05241f5ab70cf79388a0f113bc6877780ed1024a

and I observed that now, I am not getting any error/exception when I use the GetSupportedInterfaceOrientations(). I am able to successfully build and deploy application.

Screencast: http://www.screencast.com/t/xPWbrx3G4HAD