Permalink
Browse files

Fix orientation for ios 6

  • Loading branch information...
1 parent 9378516 commit 2260ab048185e0628db9fab0bdaa18c7829571f8 @serp256 committed Sep 28, 2012
View
@@ -1,7 +1,7 @@
include myconfig.ios
export PLATFORM = IOS
-SDK_VERSION ?= 5.1
-GCC ?= clang
+SDK_VERSION ?= 6.0
+GCC ?= gcc
ARCH ?= armv7
PLAT ?= /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
SDK ?= /Developer/SDKs/iPhoneOS$(SDK_VERSION).sdk
@@ -1,6 +1,7 @@
#import <UIKit/UIKit.h>
#import "LightViewController.h"
+
@interface LightAppDelegate : NSObject <UIApplicationDelegate,OrientationDelegate> {
UIAlertView * inappPurchaseActivity;
LightViewController * lightViewController;
@@ -127,6 +127,14 @@ -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceO
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
+-(BOOL)shouldAutorotate {
+ return YES;
+}
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationPortrait;
+}
+
- (void)dealloc {
[lightViewController release];
[_window release];
@@ -14,6 +14,8 @@
@protocol OrientationDelegate
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
+- (BOOL)shouldAutorotate;
+- (NSUInteger)supportedInterfaceOrientations;
@end
@interface LightViewController : UIViewController <GKAchievementViewControllerDelegate, GKLeaderboardViewControllerDelegate, SKPaymentTransactionObserver> {
@@ -248,7 +248,6 @@ -(void)hideActivityIndicator {
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
- // Return YES for supported orientations
if (_orientationDelegate) {
BOOL res = [_orientationDelegate shouldAutorotateToInterfaceOrientation:interfaceOrientation];
return res;
@@ -257,6 +256,21 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
+- (BOOL)shouldAutorotate {
+ if (_orientationDelegate && [_orientationDelegate respondsToSelector:@selector(shouldAutorotate)]) {
+ return [_orientationDelegate shouldAutorotate];
+ }
+ else
+ return YES;
+}
+
+- (NSUInteger)supportedInterfaceOrientations {
+ if (_orientationDelegate && [_orientationDelegate respondsToSelector:@selector(supportedInterfaceOrientations)]) {
+ return [_orientationDelegate supportedInterfaceOrientations];
+ }
+ else
+ return UIInterfaceOrientationPortrait;
+}
/* handle payment transactions */
@@ -292,10 +306,15 @@ - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)tran
}
if (Is_block(payment_error_cb)) {
caml_acquire_runtime_system();
- caml_callback3(payment_error_cb,
- caml_copy_string([transaction.payment.productIdentifier cStringUsingEncoding:NSUTF8StringEncoding]),
- caml_copy_string([e cStringUsingEncoding:NSUTF8StringEncoding]),
- Val_bool(transaction.error.code == SKErrorPaymentCancelled));
+ value ml_product_id = 0, ml_error_msg = 0;
+ NSLog(@"PAYMENT ERORR FOR: '%@'",transaction.payment.productIdentifier);
+ Begin_roots2(ml_product_id,ml_error_msg);
+ ml_product_id = caml_copy_string([transaction.payment.productIdentifier cStringUsingEncoding:NSUTF8StringEncoding]);
+ if (e.length > 0)
+ ml_error_msg = caml_copy_string([e cStringUsingEncoding:NSUTF8StringEncoding]);
+ else ml_error_msg = caml_alloc_string(0);
+ caml_callback3(payment_error_cb, ml_product_id,ml_error_msg,Val_bool(transaction.error.code == SKErrorPaymentCancelled));
+ End_roots();
caml_release_runtime_system();
}
[[SKPaymentQueue defaultQueue] finishTransaction: transaction];
@@ -36,11 +36,6 @@
distribution.
*/
-#if __has_feature(objc_arc)
-#error This file uses the classic non-ARC retain/release model; hints below...
-// to selectively compile this file as non-ARC, do as follows:
-// https://img.skitch.com/20120717-g3ag5h9a6ehkgpmpjiuen3qpwp.png
-#endif
#import "TJCOpenUDID.h"
#import <CommonCrypto/CommonDigest.h> // Need to import for CC_MD5 access

0 comments on commit 2260ab0

Please sign in to comment.