Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support for Xcode 6 beta 6

  • Loading branch information...
commit 17e6f1a62ca846c9c6535a8104a0f7e7a1221a66 1 parent 2c51b2b
@0xced authored
View
27 Classes/AppDelegate.m
@@ -23,10 +23,10 @@ - (void) applicationDidFinishLaunching:(UIApplication *)application
NSString *mobileApplicationsPath = NSProcessInfo.processInfo.environment[@"MOBILE_APPLICATIONS_DIRECTORY"];
if (!mobileApplicationsPath)
{
- NSString *simulatorHostHome = NSProcessInfo.processInfo.environment[@"IPHONE_SIMULATOR_HOST_HOME"];
+ NSString *homeDirectory = [self homeDirectory];
for (NSString *path in @[ @"Music/iTunes/Mobile Applications", @"Music/iTunes/iTunes Media/Mobile Applications" ])
{
- NSString *fullPath = [simulatorHostHome stringByAppendingPathComponent:path];
+ NSString *fullPath = [homeDirectory stringByAppendingPathComponent:path];
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath])
mobileApplicationsPath = fullPath;
}
@@ -71,9 +71,23 @@ - (void) applicationDidFinishLaunching:(UIApplication *)application
- (NSString *) homeDirectory
{
- NSString *logname = [NSString stringWithCString:getenv("LOGNAME") encoding:NSUTF8StringEncoding];
- struct passwd *pw = getpwnam([logname UTF8String]);
- return pw ? [NSString stringWithCString:pw->pw_dir encoding:NSUTF8StringEncoding] : [@"/Users" stringByAppendingPathComponent:logname];
+ for (NSString *simulatorHostHomeVariable in @[ @"IPHONE_SIMULATOR_HOST_HOME", @"SIMULATOR_HOST_HOME" ])
+ {
+ char *simulatorHostHome = getenv([simulatorHostHomeVariable UTF8String]);
+ if (simulatorHostHome)
+ return @(simulatorHostHome);
+ }
+
+ char *lognameEnv = getenv("LOGNAME");
+ if (lognameEnv)
+ {
+ struct passwd *pw = getpwnam(lognameEnv);
+ return pw ? [NSString stringWithCString:pw->pw_dir encoding:NSUTF8StringEncoding] : [@"/Users" stringByAppendingPathComponent:@(lognameEnv)];
+ }
+ else
+ {
+ return @"/Users/Shared";
+ }
}
- (NSString *) saveDirectory:(NSString *)subDirectory
@@ -83,8 +97,7 @@ - (NSString *) saveDirectory:(NSString *)subDirectory
if (!saveDirectory)
{
#if TARGET_IPHONE_SIMULATOR
- NSString *simulatorHostHome = NSProcessInfo.processInfo.environment[@"IPHONE_SIMULATOR_HOST_HOME"] ?: [self homeDirectory];
- saveDirectory = [NSString stringWithFormat:@"%@/Desktop/%@ %@ artwork", simulatorHostHome, [UIDevice currentDevice].model, [UIDevice currentDevice].systemVersion];
+ saveDirectory = [NSString stringWithFormat:@"%@/Desktop/%@ %@ artwork", [self homeDirectory], [UIDevice currentDevice].model, [UIDevice currentDevice].systemVersion];
#else
saveDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
#endif
View
4 iOS Artwork Extractor.xcodeproj/project.pbxproj
@@ -482,7 +482,7 @@
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
@@ -495,7 +495,7 @@
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
SDKROOT = iphoneos;
};
name = Release;
Please sign in to comment.
Something went wrong with that request. Please try again.