Skip to content
Browse files

Merge pull request #1 from iosdeveloper/master

Compatibility fixes for iOS 5
  • Loading branch information...
2 parents 8269aea + 692d6a6 commit c8934cc3510036c2cde0648541f18533387e670e @hongrich committed Nov 9, 2011
Showing with 34 additions and 11 deletions.
  1. +4 −0 Classes/DashboardAppDelegate.m
  2. +20 −5 Classes/DashboardBrowserViewController.m
  3. +10 −6 Dashboard.xcodeproj/project.pbxproj
View
4 Classes/DashboardAppDelegate.m
@@ -126,6 +126,10 @@ - (void)applicationWillTerminate:(UIApplication *)application {
*/
}
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+ [self applicationWillTerminate:application];
+}
+
- (void)applicationDidBecomeActive:(UIApplication *)application {
[self.viewController.widgetsView reloadWidgets];
}
View
25 Classes/DashboardBrowserViewController.m
@@ -86,7 +86,11 @@ - (IBAction)cancel {
actionSheet = nil;
}
[self.webView stopLoading];
- [[self parentViewController] dismissModalViewControllerAnimated:YES];
+ if ([self respondsToSelector:@selector(presentingViewController)]) {
+ [[self presentingViewController] dismissModalViewControllerAnimated:YES];
+ } else {
+ [[self parentViewController] dismissModalViewControllerAnimated:YES];
+ }
}
- (IBAction)goHome {
@@ -128,12 +132,23 @@ - (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *
BOOL allowOpenSocial = [[[NSUserDefaults standardUserDefaults] stringForKey:@"preference_opensocial_server"] length] > 0;
if ([[[request URL] path] hasSuffix:@".zip"] || [[[request URL] path] hasSuffix:@".widget"] ||
(allowOpenSocial && [[[request URL] path] hasSuffix:@".xml"])) {
- if ([[self parentViewController] isKindOfClass:[DashboardViewController class]]) {
- DashboardViewController *viewController = (DashboardViewController*)[self parentViewController];
- [viewController.widgetsView addItem:request];
+ if ([self respondsToSelector:@selector(presentingViewController)]) {
+ if ([[self presentingViewController] isKindOfClass:[DashboardViewController class]]) {
+ DashboardViewController *viewController = (DashboardViewController*)[self presentingViewController];
+ [viewController.widgetsView addItem:request];
+ }
+ } else {
+ if ([[self parentViewController] isKindOfClass:[DashboardViewController class]]) {
+ DashboardViewController *viewController = (DashboardViewController*)[self parentViewController];
+ [viewController.widgetsView addItem:request];
+ }
}
- [[self parentViewController] dismissModalViewControllerAnimated:YES];
+ if ([self respondsToSelector:@selector(presentingViewController)]) {
+ [[self presentingViewController] dismissModalViewControllerAnimated:YES];
+ } else {
+ [[self parentViewController] dismissModalViewControllerAnimated:YES];
+ }
return NO;
}
View
16 Dashboard.xcodeproj/project.pbxproj
@@ -275,9 +275,16 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Dashboard" */;
compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ en,
+ );
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
@@ -392,9 +399,8 @@
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "7BF5BA98-BEFD-4EF7-A08E-C0256D7264D7";
- SDKROOT = iphoneos3.2;
+ SDKROOT = iphoneos;
VALID_ARCHS = armv7;
};
name = "Ad-Hoc";
@@ -430,8 +436,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
- PREBINDING = NO;
- SDKROOT = iphoneos3.2;
+ SDKROOT = iphoneos;
VALID_ARCHS = armv7;
};
name = Debug;
@@ -445,8 +450,7 @@
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = iphoneos3.2;
+ SDKROOT = iphoneos;
VALID_ARCHS = armv7;
};
name = Release;

0 comments on commit c8934cc

Please sign in to comment.
Something went wrong with that request. Please try again.