diff --git a/Mini vMac.xcodeproj/project.pbxproj b/Mini vMac.xcodeproj/project.pbxproj index 98593a9..bddf137 100644 --- a/Mini vMac.xcodeproj/project.pbxproj +++ b/Mini vMac.xcodeproj/project.pbxproj @@ -159,7 +159,7 @@ isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; - dstSubfolderSpec = 13; + dstSubfolderSpec = 10; files = ( 281BB6C91D231F7700BF87B0 /* MacII-640x480.framework in Embed Frameworks */, 289710DF1CFB12660089D463 /* Mac128K.framework in Embed Frameworks */, @@ -831,7 +831,7 @@ 28F676BB1CD15E0B00FC6FA6 /* Resources */, 28F6B4CD1CF76D88002D76D0 /* Set Git version in Info.plist */, 283422D61CF8EF8C0088B634 /* Embed Frameworks */, - 283422F51CF9ACAD0088B634 /* Change PlugIn extensions to mnvm */, + 283422F51CF9ACAD0088B634 /* Change emulator bundle extensions to mnvm */, ); buildRules = ( ); @@ -1015,19 +1015,19 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 283422F51CF9ACAD0088B634 /* Change PlugIn extensions to mnvm */ = { + 283422F51CF9ACAD0088B634 /* Change emulator bundle extensions to mnvm */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Change PlugIn extensions to mnvm"; + name = "Change emulator bundle extensions to mnvm"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd \"$BUILT_PRODUCTS_DIR/$PLUGINS_FOLDER_PATH\"\nrm -rf *.mnvm\nfor name in *.framework\ndo\n mv \"$name\" \"${name%.framework}.mnvm\"\ndone\n"; + shellScript = "cd \"$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH\"\nrm -rf *.mnvm\nfor name in *.framework\ndo\n mv \"$name\" \"${name%.framework}.mnvm\"\ndone\n"; }; 28F6B4CD1CF76D88002D76D0 /* Set Git version in Info.plist */ = { isa = PBXShellScriptBuildPhase; diff --git a/Mini vMac.xcodeproj/xcshareddata/xcschemes/Mini vMac.xcscheme b/Mini vMac.xcodeproj/xcshareddata/xcschemes/Mini vMac.xcscheme index d5076c5..28523e2 100644 --- a/Mini vMac.xcodeproj/xcshareddata/xcschemes/Mini vMac.xcscheme +++ b/Mini vMac.xcodeproj/xcshareddata/xcschemes/Mini vMac.xcscheme @@ -27,8 +27,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + - - *diskImageExtensions; @property (nonatomic, readonly) NSArray *emulatorBundles; +@property (nonatomic, readonly) NSString *emulatorBundlesPath; @property (readonly, nonatomic, getter = isSandboxed) BOOL sandboxed; + (instancetype)sharedInstance; diff --git a/Mini vMac/AppDelegate.m b/Mini vMac/AppDelegate.m index 9356fcc..74d08c8 100644 --- a/Mini vMac/AppDelegate.m +++ b/Mini vMac/AppDelegate.m @@ -84,12 +84,15 @@ NSString *DocumentsChangedNotification = @"documentsChanged"; } } +- (NSString*)emulatorBundlesPath { + return [NSBundle mainBundle].privateFrameworksPath; +} + - (NSArray*)emulatorBundles { - NSString *pluginsPath = [NSBundle mainBundle].builtInPlugInsPath; - NSArray *names = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pluginsPath error:NULL]; + NSArray *names = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.emulatorBundlesPath error:NULL]; NSMutableArray *emulatorBundles = [NSMutableArray arrayWithCapacity:names.count]; for (NSString *name in [names pathsMatchingExtensions:@[@"mnvm"]]) { - NSBundle *bundle = [NSBundle bundleWithPath:[pluginsPath stringByAppendingPathComponent:name]]; + NSBundle *bundle = [NSBundle bundleWithPath:[self.emulatorBundlesPath stringByAppendingPathComponent:name]]; [emulatorBundles addObject:bundle]; } return emulatorBundles; @@ -97,7 +100,7 @@ NSString *DocumentsChangedNotification = @"documentsChanged"; - (BOOL)loadEmulator:(NSString*)name { NSString *emulatorBundleName = [name stringByAppendingPathExtension:@"mnvm"]; - NSString *emulatorBundlePath = [[NSBundle mainBundle].builtInPlugInsPath stringByAppendingPathComponent:emulatorBundleName]; + NSString *emulatorBundlePath = [self.emulatorBundlesPath stringByAppendingPathComponent:emulatorBundleName]; NSBundle *emulatorBundle = [NSBundle bundleWithPath:emulatorBundlePath]; [emulatorBundle load]; sharedEmulator = [[emulatorBundle principalClass] new]; diff --git a/Mini vMac/SettingsViewController.m b/Mini vMac/SettingsViewController.m index 98e04ab..c498b3c 100644 --- a/Mini vMac/SettingsViewController.m +++ b/Mini vMac/SettingsViewController.m @@ -247,7 +247,6 @@ typedef enum : NSInteger { BOOL rowIsHeader = [item isKindOfClass:[NSString class]]; BOOL rowHasHeader = [groupedEmulatorBundles containsObject:item]; NSBundle *bundle = rowIsHeader ? machineList[indexPath.row + 1] : item; - NSString *bundleName = bundle.bundlePath.lastPathComponent.stringByDeletingPathExtension; cell = [tableView dequeueReusableCellWithIdentifier:@"machine" forIndexPath:indexPath]; if (rowIsHeader) { cell.textLabel.text = [bundle objectForInfoDictionaryKey:@"CFBundleDisplayName"]; @@ -264,7 +263,7 @@ typedef enum : NSInteger { cell.imageView.image = nil; cell.indentationLevel = 1; } else { - NSString *iconName = [NSString stringWithFormat:@"PlugIns/%@.mnvm/Icon", bundleName]; + NSString *iconName = [NSString stringWithFormat:@"%@/Icon", bundle.bundlePath]; cell.imageView.image = [UIImage imageNamed:iconName]; cell.indentationLevel = 0; }