Permalink
Browse files

Futureproofing.

  • Loading branch information...
1 parent f8724ec commit 70401669a1b07607cf99fecc0f3061f384ae2d5c @ccgus committed Mar 21, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 jscocoa/JSCocoa/JSCocoaController.m
@@ -249,7 +249,15 @@ - (id)initWithGlobalContext:(JSGlobalContextRef)_ctx
[self loadFrameworkWithName:@"AppKit"];
[self loadFrameworkWithName:@"CoreFoundation"];
[self loadFrameworkWithName:@"Foundation"];
- [self loadFrameworkWithName:@"CoreGraphics" inPath:@"/System/Library/Frameworks/ApplicationServices.framework/Frameworks"];
+
+ // CoreGraphics.framework moved in 10.8
+ if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Library/Frameworks/CoreGraphics.framework"]) {
+ [self loadFrameworkWithName:@"CoreGraphics"];
+ }
+ else {
+ [self loadFrameworkWithName:@"CoreGraphics" inPath:@"/System/Library/Frameworks/ApplicationServices.framework/Frameworks"];
+ }
+
#endif
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE

0 comments on commit 7040166

Please sign in to comment.