Permalink
Browse files

Fixed some issues when trying to compile with GCC 4.2.

  • Loading branch information...
1 parent fa0580e commit 0d9a9559ec2aba0cac8b5bdfc37eb75e3efa4f97 @Inferis Inferis committed Feb 8, 2012
Showing with 14 additions and 7 deletions.
  1. +4 −4 ViewDeckExample/AppDelegate.h
  2. +3 −3 ViewDeckExample/NestViewController.m
  3. +7 −0 ViewDeckExample/main.m
@@ -9,10 +9,10 @@
@interface AppDelegate : UIResponder <UIApplicationDelegate>
-@property (strong, nonatomic) UIWindow *window;
+@property (retain, nonatomic) UIWindow *window;
-@property (strong, nonatomic) UIViewController *centerController;
-@property (strong, nonatomic) UIViewController *leftController;
-@property (strong, nonatomic) UIViewController *imageController;
+@property (retain, nonatomic) UIViewController *centerController;
+@property (retain, nonatomic) UIViewController *leftController;
+@property (retain, nonatomic) UIViewController *imageController;
@end
@@ -32,7 +32,7 @@ - (void)viewDidLoad
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if (self.level == 1) {
- [UIApplication.sharedApplication setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
+ [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
self.viewDeckController.view.frame = [[UIScreen mainScreen] applicationFrame];
[self.viewDeckController.view setNeedsDisplay]; // .frame = self.viewDeckController.view.bounds;
}
@@ -41,14 +41,14 @@ - (void)viewWillAppear:(BOOL)animated {
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
if (self.level == 1) {
- [UIApplication.sharedApplication setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
+ [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
self.viewDeckController.view.frame = [[UIScreen mainScreen] applicationFrame];
[self.viewDeckController.view setNeedsDisplay]; // .frame = self.viewDeckController.view.bounds;
}
}
- (void)hideOrShow {
- [UIApplication.sharedApplication setStatusBarHidden:!UIApplication.sharedApplication.isStatusBarHidden withAnimation:UIStatusBarAnimationSlide];
+ [[UIApplication sharedApplication] setStatusBarHidden:![UIApplication sharedApplication].isStatusBarHidden withAnimation:UIStatusBarAnimationSlide];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
View
@@ -9,7 +9,14 @@
int main(int argc, char *argv[])
{
+#if __has_feature(objc_arc) && __clang_major__ >= 3
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
+#else
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ [pool release];
+ return retVal;
+#endif // __has_feature(objc_arc)
}

0 comments on commit 0d9a955

Please sign in to comment.