1. My game is on landscape mode. When I try to enter game center, it's no problem on emulator, but on my touch (with iOS 6.0), it's crashed and shows this log
MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: UIApplicationInvalidInterfaceOrientation Reason: Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
at com.catstudio.littlesoldiers.Application.Main (System.String[] args) [0x00000] in /Users/cat/Desktop/workspace/LittleCommander-ios/Main.cs:107
2. On emulator when I try to hit 'done' button of GKAchievementView, I write the code as below, the game center view dismissed but the screen is totally black. The game is not crash because I still hear BGM.
- Code: Select all
if (lp.Authenticated) {
Console.WriteLine ("player authed 1111" + lp);
UIViewController controller = UIApplication.SharedApplication.Windows [0].RootViewController;
GKAchievementViewController center = new GKAchievementViewController ();
center.DidFinish += delegate {
controller.DismissModalViewControllerAnimated(true);
};
controller.PresentModalViewController(center,true);
} else {
UIApplication.SharedApplication.BeginInvokeOnMainThread (delegate {
lp.Authenticate (delegate(NSError error) {// log errors
Console.WriteLine ("=====player auth========" +(error!=null?error.Code:0)+" - "+ error);
});
});
}
Could someone help me, I badly need the game center function. Thank you
