diff --git a/.gitignore b/.gitignore index 5fd25f9..ced3cac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +Core Data Editor/Core Data Editor.xcodeproj/xcuserdata +CDE-Workspace.xcworkspace/xcuserdata/* # OS X .DS_Store diff --git a/.travis.yml b/.travis.yml index 131abc6..e936b53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,3 @@ +osx_image: xcode8.2 language: objective-c -osx_image: xcode8 -before_install: - - brew update - - if brew outdated | grep -qx xctool; then brew upgrade xctool; fi -script: xcodebuild -workspace CDE-Workspace.xcworkspace -scheme CDETests test +script: xcodebuild -verbose -scheme "Core Data Editor" -workspace CDE-Workspace.xcworkspace build diff --git a/CDE-Workspace.xcworkspace/xcshareddata/xcschemes/CDETests.xcscheme b/CDE-Workspace.xcworkspace/xcshareddata/xcschemes/CDETests.xcscheme index 21d0396..240f562 100644 --- a/CDE-Workspace.xcworkspace/xcshareddata/xcschemes/CDETests.xcscheme +++ b/CDE-Workspace.xcworkspace/xcshareddata/xcschemes/CDETests.xcscheme @@ -1,6 +1,6 @@ - - - - @@ -62,16 +53,15 @@ debugXPCServices = "NO" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - + - + @@ -81,15 +71,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - - - - diff --git a/CDE-Workspace.xcworkspace/xcshareddata/xcschemes/Core Data Editor.xcscheme b/CDE-Workspace.xcworkspace/xcshareddata/xcschemes/Core Data Editor.xcscheme index 04909af..7081d23 100644 --- a/CDE-Workspace.xcworkspace/xcshareddata/xcschemes/Core Data Editor.xcscheme +++ b/CDE-Workspace.xcworkspace/xcshareddata/xcschemes/Core Data Editor.xcscheme @@ -1,6 +1,6 @@ - - - - *)supportedAttributes_cde; +- (NSArray *)toManyRelationships_cde; +- (NSDictionary*)toManyRelationshipsByName_cde; +- (NSArray *)sortedToManyRelationshipNames_cde; +- (NSArray *)sortedToManyRelationships_cde; +- (NSArray *)sortedToOneRelationships_cde; +- (NSArray *)sortedRelationships_cde; - (NSAttributeDescription *)attributeDescriptionForName_cde:(NSString *)attributeName; -#pragma mark - CSV -//// returns an array of arrays -//- (NSArray *)CSVValuesForEachManagedObjectInArray_cde:(NSArray *)objects; -// -//// This method filters out any non supported property names and also respects the sorting of propertyNames -//- (NSArray *)CSVValuesForEachManagedObjectInArray:(NSArray *)objects forPropertyNames:(NSArray *)propertyNames includeHeaderValues_cde:(BOOL)includeHeaderValues; -//- (NSArray *)supportedCSVAttributes_cde; - #pragma mark - UI - (UIImage *)icon_cde; diff --git a/CDEKit/CDEKit/NSEntityDescription+CDEAdditions.m b/CDEKit/CDEKit/NSEntityDescription+CDEAdditions.m index 7493666..724fe94 100644 --- a/CDEKit/CDEKit/NSEntityDescription+CDEAdditions.m +++ b/CDEKit/CDEKit/NSEntityDescription+CDEAdditions.m @@ -4,151 +4,91 @@ @implementation NSEntityDescription (CDEAdditions) #pragma mark - Convenience -- (NSArray *)supportedAttributes_cde { - NSMutableArray *result = [NSMutableArray new]; - for(NSAttributeDescription *attribute in [[self attributesByName] allValues]) { - // Ignore transient properties - if(attribute.isTransient) { - continue; - } - if(!attribute.isSupportedAttribute_cde) { - continue; - } - - [result addObject:attribute]; +- (NSArray *)supportedAttributes_cde { + NSMutableArray *result = [NSMutableArray new]; + for(NSAttributeDescription *attribute in [[self attributesByName] allValues]) { + // Ignore transient properties + if(attribute.isTransient) { + continue; } - return result; + if(!attribute.isSupportedAttribute_cde) { + continue; + } + + [result addObject:attribute]; + } + return result; } -- (NSArray *)toManyRelationships_cde { - NSMutableArray *result = [NSMutableArray new]; - [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(id key, NSRelationshipDescription *relation, BOOL *stop) { - if(relation.isToMany == NO) { - return; - } - [result addObject:relation]; - }]; - return result; +- (NSArray *)toManyRelationships_cde { + NSMutableArray *result = [NSMutableArray new]; + [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(id key, NSRelationshipDescription *relation, BOOL *stop) { + if(relation.isToMany == NO) { + return; + } + [result addObject:relation]; + }]; + return result; } -- (NSDictionary *)toManyRelationshipsByName_cde { - NSMutableDictionary *result = [NSMutableDictionary new]; - [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(NSString *name, NSRelationshipDescription *relation, BOOL *stop) { - if(relation.isToMany == NO) { - return; - } - result[name] = relation; - }]; - return result; +- (NSDictionary *)toManyRelationshipsByName_cde { + NSMutableDictionary *result = [NSMutableDictionary new]; + [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(NSString *name, NSRelationshipDescription *relation, BOOL *stop) { + if(relation.isToMany == NO) { + return; + } + result[name] = relation; + }]; + return result; } -- (NSArray *)sortedToManyRelationshipNames_cde { - NSArray *unsorted = [[self toManyRelationshipsByName_cde] allKeys]; - return [unsorted sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSString *relationA, NSString *relationB) { - return [relationA localizedStandardCompare:relationB]; - }]; +- (NSArray *)sortedToManyRelationshipNames_cde { + NSArray *unsorted = [[self toManyRelationshipsByName_cde] allKeys]; + return [unsorted sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSString *relationA, NSString *relationB) { + return [relationA localizedStandardCompare:relationB]; + }]; } -- (NSArray *)sortedToManyRelationships_cde { - NSMutableArray *result = [NSMutableArray new]; - [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(id key, NSRelationshipDescription *relation, BOOL *stop) { - if(relation.isToMany == NO) { - return; - } - [result addObject:relation]; - }]; - return [result sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSRelationshipDescription *relationA, NSRelationshipDescription *relationB) { - return [relationA.name localizedStandardCompare:relationB.name]; - }]; +- (NSArray *)sortedToManyRelationships_cde { + NSMutableArray *result = [NSMutableArray new]; + [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(id key, NSRelationshipDescription *relation, BOOL *stop) { + if(relation.isToMany == NO) { + return; + } + [result addObject:relation]; + }]; + return [result sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSRelationshipDescription *relationA, NSRelationshipDescription *relationB) { + return [relationA.name localizedStandardCompare:relationB.name]; + }]; } -- (NSArray *)sortedToOneRelationships_cde { - NSMutableArray *result = [NSMutableArray new]; - [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(id key, NSRelationshipDescription *relation, BOOL *stop) { - if(relation.isToMany) { - return; - } - [result addObject:relation]; - }]; - return [result sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSRelationshipDescription *relationA, NSRelationshipDescription *relationB) { - return [relationA.name localizedStandardCompare:relationB.name]; - }]; +- (NSArray *)sortedToOneRelationships_cde { + NSMutableArray *result = [NSMutableArray new]; + [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(id key, NSRelationshipDescription *relation, BOOL *stop) { + if(relation.isToMany) { + return; + } + [result addObject:relation]; + }]; + return [result sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSRelationshipDescription *relationA, NSRelationshipDescription *relationB) { + return [relationA.name localizedStandardCompare:relationB.name]; + }]; } -- (NSArray *)sortedRelationships_cde { - return [self.relationshipsByName.allValues sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSRelationshipDescription *relationA, NSRelationshipDescription *relationB) { - return [relationA.name localizedStandardCompare:relationB.name]; - }]; +- (NSArray *)sortedRelationships_cde { + return [self.relationshipsByName.allValues sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSRelationshipDescription *relationA, NSRelationshipDescription *relationB) { + return [relationA.name localizedStandardCompare:relationB.name]; + }]; } -//- (NSString *)nameForDisplay_cde { -// return [self.name humanReadableStringAccordingToUserDefaults_cde]; -//} - - (NSAttributeDescription *)attributeDescriptionForName_cde:(NSString *)attributeName { - NSParameterAssert(attributeName); - return self.attributesByName[attributeName]; + NSParameterAssert(attributeName); + return self.attributesByName[attributeName]; } -//#pragma mark - CSV -//// returns an array of arrays -//- (NSArray *)CSVValuesForEachManagedObjectInArray_cde:(NSArray *)objects { -// NSParameterAssert(objects); -// NSArray *supportedAttributes = self.supportedCSVAttributes_cde; -// NSArray *supportedAttributeNames = [supportedAttributes valueForKey:@"name"]; -// return [self CSVValuesForEachManagedObjectInArray:objects forPropertyNames:supportedAttributeNames includeHeaderValues_cde:NO]; -//} -// -//// This method filters out any non supported property names and also respects the sorting of propertyNames -//- (NSArray *)CSVValuesForEachManagedObjectInArray:(NSArray *)objects forPropertyNames:(NSArray *)propertyNames includeHeaderValues_cde:(BOOL)includeHeaderValues { -// NSParameterAssert(objects); -// NSParameterAssert(propertyNames); -// -// NSMutableArray *supportedAttributeNames = [NSMutableArray new]; -// for(NSString *propertyName in propertyNames) { -// if([propertyName isEqualToString:@"objectID"]) { -// [supportedAttributeNames addObject:propertyName]; -// continue; -// } -// NSAttributeDescription *attribute = self.attributesByName[propertyName]; -// if(attribute == nil) { -// continue; -// } -// if(!attribute.isSupportedAttribute_cde || !attribute.isSupportedCSVAttribute_cde) { -// continue; -// } -// [supportedAttributeNames addObject:attribute.name]; -// } -// -// NSMutableArray *result = [NSMutableArray arrayWithCapacity:objects.count + 1]; -// -// if(includeHeaderValues) { -// [result addObject:supportedAttributeNames]; -// } -// -// for(NSManagedObject *object in objects) { -// NSAssert([object.entity isKindOfEntity:self], @"Entity mismatch"); -// NSArray *values = [object CSVValuesForAttributeNames_cde:supportedAttributeNames]; -// [result addObject:values]; -// } -// -// return result; -//} -// -//- (NSArray *)supportedCSVAttributes_cde { -// NSMutableArray *result = [NSMutableArray new]; -// for(NSAttributeDescription *attribute in self.supportedAttributes_cde) { -// if(attribute.isSupportedCSVAttribute_cde) { -// [result addObject:attribute]; -// } -// } -// return result; -//} - #pragma mark - UI - (UIImage *)icon_cde { return nil; -// return [UIImage imageNamed:@"entity-icon-small"]; } @end diff --git a/Core Data Editor/CDETests/CDETests.swift b/Core Data Editor/CDETests/CDETests.swift deleted file mode 100644 index 410c1d6..0000000 --- a/Core Data Editor/CDETests/CDETests.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// CDETests.swift -// CDETests -// -// Created by cmk on 16/10/2016. -// Copyright © 2016 Christian Kienle. All rights reserved. -// - -import XCTest - -class CDETests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/Core Data Editor/CDETests/Info.plist b/Core Data Editor/CDETests/Info.plist deleted file mode 100644 index 6c6c23c..0000000 --- a/Core Data Editor/CDETests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/Core Data Editor/Core Data Editor.xcodeproj/project.pbxproj b/Core Data Editor/Core Data Editor.xcodeproj/project.pbxproj index ad5ec64..68e3262 100644 --- a/Core Data Editor/Core Data Editor.xcodeproj/project.pbxproj +++ b/Core Data Editor/Core Data Editor.xcodeproj/project.pbxproj @@ -54,12 +54,9 @@ AB2D343017A04CA600A1B0CA /* CDETextEditorController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB2D342F17A04CA600A1B0CA /* CDETextEditorController.m */; }; AB2D343517A04CCD00A1B0CA /* CDETextEditorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB2D343317A04CCD00A1B0CA /* CDETextEditorViewController.m */; }; AB2D343617A04CCD00A1B0CA /* CDETextEditorViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB2D343417A04CCD00A1B0CA /* CDETextEditorViewController.xib */; }; - AB30FF66179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB30FF64179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.m */; }; - AB30FF67179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB30FF65179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.xib */; }; - AB30FF6B179C6AB400E49E0B /* CDEPreferencesFormattingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB30FF69179C6AB400E49E0B /* CDEPreferencesFormattingViewController.m */; }; - AB30FF6C179C6AB400E49E0B /* CDEPreferencesFormattingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB30FF6A179C6AB400E49E0B /* CDEPreferencesFormattingViewController.xib */; }; - AB30FF70179C6B1700E49E0B /* CDEPreferencesMiscViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB30FF6E179C6B1700E49E0B /* CDEPreferencesMiscViewController.m */; }; - AB30FF71179C6B1700E49E0B /* CDEPreferencesMiscViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB30FF6F179C6B1700E49E0B /* CDEPreferencesMiscViewController.xib */; }; + AB30FF66179C696D00E49E0B /* PreferencesIntegrationVC.m in Sources */ = {isa = PBXBuildFile; fileRef = AB30FF64179C696D00E49E0B /* PreferencesIntegrationVC.m */; }; + AB30FF6B179C6AB400E49E0B /* PreferencesFormattingVC.m in Sources */ = {isa = PBXBuildFile; fileRef = AB30FF69179C6AB400E49E0B /* PreferencesFormattingVC.m */; }; + AB30FF70179C6B1700E49E0B /* PreferencesGeneralVC.m in Sources */ = {isa = PBXBuildFile; fileRef = AB30FF6E179C6B1700E49E0B /* PreferencesGeneralVC.m */; }; AB36447E17BA47D4004ADAAC /* CDESetupWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB36447C17BA47D4004ADAAC /* CDESetupWindowController.m */; }; AB36447F17BA47D4004ADAAC /* CDESetupWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB36447D17BA47D4004ADAAC /* CDESetupWindowController.xib */; }; AB3B078E1775D39A000855B0 /* CDEStringValueTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = AB3B078D1775D39A000855B0 /* CDEStringValueTableCellView.m */; }; @@ -69,14 +66,18 @@ AB3B07CE17760E23000855B0 /* NSTableCellView+JKNibLoading.m in Sources */ = {isa = PBXBuildFile; fileRef = AB3B07CD17760E23000855B0 /* NSTableCellView+JKNibLoading.m */; }; AB531222179953B300529EF7 /* NSTableColumn+CDERequestDataCoordinator.m in Sources */ = {isa = PBXBuildFile; fileRef = AB531221179953B300529EF7 /* NSTableColumn+CDERequestDataCoordinator.m */; }; AB5583A5176751AE005C002C /* icon.iconset in Resources */ = {isa = PBXBuildFile; fileRef = AB5583A4176751AE005C002C /* icon.iconset */; }; - AB7EF6B11DB4028D0062DD0C /* CDETests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7EF6B01DB4028D0062DD0C /* CDETests.swift */; }; - AB7F20CE19DD7B4D00EBBF52 /* VibrantView.m in Sources */ = {isa = PBXBuildFile; fileRef = AB7F20CD19DD7B4D00EBBF52 /* VibrantView.m */; }; + AB59DA401DDF42AA00A19963 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB59DA3F1DDF42AA00A19963 /* Main.storyboard */; }; + AB59DA601DDF43FE00A19963 /* PreferencesWC.m in Sources */ = {isa = PBXBuildFile; fileRef = AB59DA5F1DDF43FE00A19963 /* PreferencesWC.m */; }; AB86F7CB1791922600FB0AEB /* CDEAttributeEditorWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB86F7C91791922600FB0AEB /* CDEAttributeEditorWindowController.m */; }; AB86F7CC1791922600FB0AEB /* CDEAttributeEditorWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB86F7CA1791922600FB0AEB /* CDEAttributeEditorWindowController.xib */; }; AB8F8342177C524B000B4467 /* CDEUnorderedRelationshipRequestDataCoordinator.m in Sources */ = {isa = PBXBuildFile; fileRef = AB8F8341177C524B000B4467 /* CDEUnorderedRelationshipRequestDataCoordinator.m */; }; AB8F8347177C7C4B000B4467 /* CDETwoColumnSplitViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB8F8346177C7C4A000B4467 /* CDETwoColumnSplitViewDelegate.m */; }; AB8F834B177C82D4000B4467 /* CDEOrderIndexTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = AB8F834A177C82D4000B4467 /* CDEOrderIndexTableCellView.m */; }; AB8F834D177C82E6000B4467 /* CDEOrderIndexTableCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB8F834C177C82E6000B4467 /* CDEOrderIndexTableCellView.xib */; }; + AB98E86B1DDF3F5900925C8A /* Preferences.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB98E86A1DDF3F5900925C8A /* Preferences.storyboard */; }; + AB98E86D1DDF405500925C8A /* PreferencesGeneral.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB98E86C1DDF405500925C8A /* PreferencesGeneral.storyboard */; }; + AB98E8711DDF413E00925C8A /* PreferencesIntegration.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB98E8701DDF413E00925C8A /* PreferencesIntegration.storyboard */; }; + AB98E8731DDF41A300925C8A /* PreferencesFormatting.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB98E8721DDF41A300925C8A /* PreferencesFormatting.storyboard */; }; AB99B2EF1998DD0400101647 /* SQLiteDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = AB99B2EE1998DD0400101647 /* SQLiteDatabase.m */; }; AB99B2F21998E1EE00101647 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AB99B2F11998E1EE00101647 /* libsqlite3.dylib */; }; ABB08F8917BD2DB000BE97C0 /* Project-Browser-Menu-Item.png in Resources */ = {isa = PBXBuildFile; fileRef = ABB08F8717BD2DB000BE97C0 /* Project-Browser-Menu-Item.png */; }; @@ -158,12 +159,6 @@ ABC1E6B117775DAC0069D252 /* NSSortDescriptor+CDEAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = ABC1E6B017775DAC0069D252 /* NSSortDescriptor+CDEAdditions.m */; }; ABC1E6B8177765CE0069D252 /* CDEEntityTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = ABC1E6B7177765CE0069D252 /* CDEEntityTableCellView.m */; }; ABC1E6BD177777940069D252 /* entity-icon-small.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC1E6BC177777940069D252 /* entity-icon-small.png */; }; - ABC83B0F17B1166300078580 /* mogenerator in Resources */ = {isa = PBXBuildFile; fileRef = ABC83B0E17B1166300078580 /* mogenerator */; }; - ABC83B1117B116A000078580 /* mogeneratorReadme.rtf in Resources */ = {isa = PBXBuildFile; fileRef = ABC83B1017B116A000078580 /* mogeneratorReadme.rtf */; }; - ABC83B1917B1170900078580 /* CDECodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = ABC83B1317B1170900078580 /* CDECodeGenerator.m */; }; - ABC83B1A17B1170900078580 /* CDEManagedObjectSubclassesGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = ABC83B1517B1170900078580 /* CDEManagedObjectSubclassesGenerator.m */; }; - ABC83B1B17B1170900078580 /* CDECodeGeneratorAccessoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABC83B1717B1170900078580 /* CDECodeGeneratorAccessoryViewController.m */; }; - ABC83B1C17B1170900078580 /* CDECodeGeneratorAccessoryViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABC83B1817B1170900078580 /* CDECodeGeneratorAccessoryViewController.xib */; }; ABC83B4E17B1215200078580 /* CDEAboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABC83B4C17B1215200078580 /* CDEAboutWindowController.m */; }; ABC83B4F17B1215200078580 /* CDEAboutWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABC83B4D17B1215200078580 /* CDEAboutWindowController.xib */; }; ABC83BDE17B24D9600078580 /* Document_Icon.iconset in Resources */ = {isa = PBXBuildFile; fileRef = ABC83BDD17B24D9600078580 /* Document_Icon.iconset */; }; @@ -207,8 +202,6 @@ ABEB75641776E70900141062 /* CDEObjectIDValueTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEB75631776E70900141062 /* CDEObjectIDValueTableCellView.m */; }; ABEB75661776E71600141062 /* CDEObjectIDValueTableCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABEB75651776E71600141062 /* CDEObjectIDValueTableCellView.xib */; }; ABEB75691776E75800141062 /* CDEManagedObjectIDToStringValueTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEB75681776E75800141062 /* CDEManagedObjectIDToStringValueTransformer.m */; }; - ABEB756F1776F37100141062 /* CDEPreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEB756D1776F37100141062 /* CDEPreferencesWindowController.m */; }; - ABEB75701776F37100141062 /* CDEPreferencesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABEB756E1776F37100141062 /* CDEPreferencesWindowController.xib */; }; ABEB75731776F61300141062 /* NSUserDefaults+CDEAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEB75721776F61300141062 /* NSUserDefaults+CDEAdditions.m */; }; ABEB75A3177705E100141062 /* CDEFloatingPointValueTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEB75A2177705E100141062 /* CDEFloatingPointValueTableCellView.m */; }; ABEB75A5177705EE00141062 /* CDEFloatingPointValueTableCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABEB75A4177705EE00141062 /* CDEFloatingPointValueTableCellView.xib */; }; @@ -222,18 +215,9 @@ ABEEA6271785C6450096DE4C /* CDEManagedObjectsPickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABEEA6251785C6450096DE4C /* CDEManagedObjectsPickerViewController.xib */; }; ABEEA6291785D7800096DE4C /* CDEIsSelectedTableCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABEEA6281785D77F0096DE4C /* CDEIsSelectedTableCellView.xib */; }; ABFBB3B1179C36E2003B5346 /* CDETwoColumnSplitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABFBB3B0179C36E2003B5346 /* CDETwoColumnSplitViewController.m */; }; + ABFFA4891DDF4784009BF96F /* PreferencesVC.m in Sources */ = {isa = PBXBuildFile; fileRef = ABFFA4881DDF4784009BF96F /* PreferencesVC.m */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - AB7EF6B31DB4028D0062DD0C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = ABBEA7CE1765CB730024A9D2 /* Project object */; - proxyType = 1; - remoteGlobalIDString = ABBEA7D51765CB730024A9D2; - remoteInfo = "Core Data Editor"; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ 2E25BCB4198D645100BBA0C0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; AB0181151997C805000FE094 /* NSDirectoryEnumerator+ProjectBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDirectoryEnumerator+ProjectBrowser.h"; sourceTree = ""; }; @@ -317,15 +301,12 @@ AB2D343217A04CCD00A1B0CA /* CDETextEditorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDETextEditorViewController.h; sourceTree = ""; }; AB2D343317A04CCD00A1B0CA /* CDETextEditorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDETextEditorViewController.m; sourceTree = ""; }; AB2D343417A04CCD00A1B0CA /* CDETextEditorViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDETextEditorViewController.xib; sourceTree = ""; }; - AB30FF63179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEPreferencesAutomaticProjectCreationViewController.h; sourceTree = ""; }; - AB30FF64179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEPreferencesAutomaticProjectCreationViewController.m; sourceTree = ""; }; - AB30FF65179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEPreferencesAutomaticProjectCreationViewController.xib; sourceTree = ""; }; - AB30FF68179C6AB400E49E0B /* CDEPreferencesFormattingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEPreferencesFormattingViewController.h; sourceTree = ""; }; - AB30FF69179C6AB400E49E0B /* CDEPreferencesFormattingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEPreferencesFormattingViewController.m; sourceTree = ""; }; - AB30FF6A179C6AB400E49E0B /* CDEPreferencesFormattingViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEPreferencesFormattingViewController.xib; sourceTree = ""; }; - AB30FF6D179C6B1700E49E0B /* CDEPreferencesMiscViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEPreferencesMiscViewController.h; sourceTree = ""; }; - AB30FF6E179C6B1700E49E0B /* CDEPreferencesMiscViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEPreferencesMiscViewController.m; sourceTree = ""; }; - AB30FF6F179C6B1700E49E0B /* CDEPreferencesMiscViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEPreferencesMiscViewController.xib; sourceTree = ""; }; + AB30FF63179C696D00E49E0B /* PreferencesIntegrationVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesIntegrationVC.h; sourceTree = ""; }; + AB30FF64179C696D00E49E0B /* PreferencesIntegrationVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesIntegrationVC.m; sourceTree = ""; }; + AB30FF68179C6AB400E49E0B /* PreferencesFormattingVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesFormattingVC.h; sourceTree = ""; }; + AB30FF69179C6AB400E49E0B /* PreferencesFormattingVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesFormattingVC.m; sourceTree = ""; }; + AB30FF6D179C6B1700E49E0B /* PreferencesGeneralVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesGeneralVC.h; sourceTree = ""; }; + AB30FF6E179C6B1700E49E0B /* PreferencesGeneralVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesGeneralVC.m; sourceTree = ""; }; AB36447B17BA47D4004ADAAC /* CDESetupWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDESetupWindowController.h; sourceTree = ""; }; AB36447C17BA47D4004ADAAC /* CDESetupWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDESetupWindowController.m; sourceTree = ""; }; AB36447D17BA47D4004ADAAC /* CDESetupWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDESetupWindowController.xib; sourceTree = ""; }; @@ -340,11 +321,9 @@ AB531220179953B300529EF7 /* NSTableColumn+CDERequestDataCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTableColumn+CDERequestDataCoordinator.h"; sourceTree = ""; }; AB531221179953B300529EF7 /* NSTableColumn+CDERequestDataCoordinator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTableColumn+CDERequestDataCoordinator.m"; sourceTree = ""; }; AB5583A4176751AE005C002C /* icon.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; path = icon.iconset; sourceTree = ""; }; - AB7EF6AE1DB4028C0062DD0C /* CDETests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDETests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - AB7EF6B01DB4028D0062DD0C /* CDETests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CDETests.swift; sourceTree = ""; }; - AB7EF6B21DB4028D0062DD0C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AB7F20CC19DD7B4D00EBBF52 /* VibrantView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VibrantView.h; sourceTree = ""; }; - AB7F20CD19DD7B4D00EBBF52 /* VibrantView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VibrantView.m; sourceTree = ""; }; + AB59DA3F1DDF42AA00A19963 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; + AB59DA5E1DDF43FE00A19963 /* PreferencesWC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesWC.h; sourceTree = ""; }; + AB59DA5F1DDF43FE00A19963 /* PreferencesWC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesWC.m; sourceTree = ""; }; AB86F7C81791922600FB0AEB /* CDEAttributeEditorWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEAttributeEditorWindowController.h; sourceTree = ""; }; AB86F7C91791922600FB0AEB /* CDEAttributeEditorWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEAttributeEditorWindowController.m; sourceTree = ""; }; AB86F7CA1791922600FB0AEB /* CDEAttributeEditorWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEAttributeEditorWindowController.xib; sourceTree = ""; }; @@ -355,6 +334,10 @@ AB8F8349177C82D4000B4467 /* CDEOrderIndexTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEOrderIndexTableCellView.h; sourceTree = ""; }; AB8F834A177C82D4000B4467 /* CDEOrderIndexTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEOrderIndexTableCellView.m; sourceTree = ""; }; AB8F834C177C82E6000B4467 /* CDEOrderIndexTableCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEOrderIndexTableCellView.xib; sourceTree = ""; }; + AB98E86A1DDF3F5900925C8A /* Preferences.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Preferences.storyboard; sourceTree = ""; }; + AB98E86C1DDF405500925C8A /* PreferencesGeneral.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = PreferencesGeneral.storyboard; sourceTree = ""; }; + AB98E8701DDF413E00925C8A /* PreferencesIntegration.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = PreferencesIntegration.storyboard; sourceTree = ""; }; + AB98E8721DDF41A300925C8A /* PreferencesFormatting.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = PreferencesFormatting.storyboard; sourceTree = ""; }; AB99B2EE1998DD0400101647 /* SQLiteDatabase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQLiteDatabase.m; sourceTree = ""; }; AB99B2F01998DD1500101647 /* SQLiteDatabase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabase.h; sourceTree = ""; }; AB99B2F11998E1EE00101647 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; @@ -507,15 +490,6 @@ ABC1E6B6177765CE0069D252 /* CDEEntityTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEEntityTableCellView.h; sourceTree = ""; }; ABC1E6B7177765CE0069D252 /* CDEEntityTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEEntityTableCellView.m; sourceTree = ""; }; ABC1E6BC177777940069D252 /* entity-icon-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "entity-icon-small.png"; sourceTree = ""; }; - ABC83B0E17B1166300078580 /* mogenerator */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = mogenerator; sourceTree = ""; }; - ABC83B1017B116A000078580 /* mogeneratorReadme.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = mogeneratorReadme.rtf; sourceTree = ""; }; - ABC83B1217B1170900078580 /* CDECodeGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDECodeGenerator.h; sourceTree = ""; }; - ABC83B1317B1170900078580 /* CDECodeGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDECodeGenerator.m; sourceTree = ""; }; - ABC83B1417B1170900078580 /* CDEManagedObjectSubclassesGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEManagedObjectSubclassesGenerator.h; sourceTree = ""; }; - ABC83B1517B1170900078580 /* CDEManagedObjectSubclassesGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEManagedObjectSubclassesGenerator.m; sourceTree = ""; }; - ABC83B1617B1170900078580 /* CDECodeGeneratorAccessoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDECodeGeneratorAccessoryViewController.h; sourceTree = ""; }; - ABC83B1717B1170900078580 /* CDECodeGeneratorAccessoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDECodeGeneratorAccessoryViewController.m; sourceTree = ""; }; - ABC83B1817B1170900078580 /* CDECodeGeneratorAccessoryViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDECodeGeneratorAccessoryViewController.xib; sourceTree = ""; }; ABC83B4B17B1215200078580 /* CDEAboutWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEAboutWindowController.h; sourceTree = ""; }; ABC83B4C17B1215200078580 /* CDEAboutWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEAboutWindowController.m; sourceTree = ""; }; ABC83B4D17B1215200078580 /* CDEAboutWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEAboutWindowController.xib; sourceTree = ""; }; @@ -588,9 +562,6 @@ ABEB75651776E71600141062 /* CDEObjectIDValueTableCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEObjectIDValueTableCellView.xib; sourceTree = ""; }; ABEB75671776E75800141062 /* CDEManagedObjectIDToStringValueTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEManagedObjectIDToStringValueTransformer.h; sourceTree = ""; }; ABEB75681776E75800141062 /* CDEManagedObjectIDToStringValueTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEManagedObjectIDToStringValueTransformer.m; sourceTree = ""; }; - ABEB756C1776F37100141062 /* CDEPreferencesWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEPreferencesWindowController.h; sourceTree = ""; }; - ABEB756D1776F37100141062 /* CDEPreferencesWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDEPreferencesWindowController.m; sourceTree = ""; }; - ABEB756E1776F37100141062 /* CDEPreferencesWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEPreferencesWindowController.xib; sourceTree = ""; }; ABEB75711776F61300141062 /* NSUserDefaults+CDEAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSUserDefaults+CDEAdditions.h"; sourceTree = ""; }; ABEB75721776F61300141062 /* NSUserDefaults+CDEAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSUserDefaults+CDEAdditions.m"; sourceTree = ""; }; ABEB75A1177705E100141062 /* CDEFloatingPointValueTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDEFloatingPointValueTableCellView.h; sourceTree = ""; }; @@ -613,16 +584,11 @@ ABEEA6281785D77F0096DE4C /* CDEIsSelectedTableCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CDEIsSelectedTableCellView.xib; sourceTree = ""; }; ABFBB3AF179C36E2003B5346 /* CDETwoColumnSplitViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDETwoColumnSplitViewController.h; sourceTree = ""; }; ABFBB3B0179C36E2003B5346 /* CDETwoColumnSplitViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDETwoColumnSplitViewController.m; sourceTree = ""; }; + ABFFA4871DDF4784009BF96F /* PreferencesVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesVC.h; sourceTree = ""; }; + ABFFA4881DDF4784009BF96F /* PreferencesVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesVC.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - AB7EF6AB1DB4028C0062DD0C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; ABBEA7D31765CB730024A9D2 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -650,7 +616,6 @@ AB36447A17BA47BF004ADAAC /* Setup Window */, ABB225CF17B91C510024FE4F /* Project Browser */, ABC83B4A17B1213C00078580 /* About */, - ABC83B1D17B1170C00078580 /* Code Generator */, ABDF8AE417A41F9A00727346 /* CSV Import */, ABEB756B1776F35E00141062 /* Preferences Window Controller */, AB0927531768C80E00FC59FB /* Editor View Controller */, @@ -752,9 +717,7 @@ AB1466C5178727F600E3EEA3 /* CDEValidationErrorsViewController.h */, AB1466C6178727F600E3EEA3 /* CDEValidationErrorsViewController.m */, AB1466C7178727F600E3EEA3 /* CDEValidationErrorsViewController.xib */, - AB1467061789A1BF00E3EEA3 /* Row View (not used) */, - AB7F20CC19DD7B4D00EBBF52 /* VibrantView.h */, - AB7F20CD19DD7B4D00EBBF52 /* VibrantView.m */, + AB1467061789A1BF00E3EEA3 /* Row View */, ); name = "Validation Errors View Controller"; sourceTree = ""; @@ -768,13 +731,13 @@ name = NSManagedObjectID; sourceTree = ""; }; - AB1467061789A1BF00E3EEA3 /* Row View (not used) */ = { + AB1467061789A1BF00E3EEA3 /* Row View */ = { isa = PBXGroup; children = ( AB1466CD1787492400E3EEA3 /* CDETableRowView.h */, AB1466CE1787492400E3EEA3 /* CDETableRowView.m */, ); - name = "Row View (not used)"; + name = "Row View "; sourceTree = ""; }; AB1467071789B16F00E3EEA3 /* Attribute Editor */ = { @@ -960,16 +923,12 @@ AB30FF73179C702900E49E0B /* View Controllers */ = { isa = PBXGroup; children = ( + AB98E8741DDF41C600925C8A /* Formatting */, + AB98E86F1DDF40F900925C8A /* Integration */, + AB98E86E1DDF40EB00925C8A /* General */, ABB225D017B922D30024FE4F /* PopUpButton */, - AB30FF63179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.h */, - AB30FF64179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.m */, - AB30FF65179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.xib */, - AB30FF68179C6AB400E49E0B /* CDEPreferencesFormattingViewController.h */, - AB30FF69179C6AB400E49E0B /* CDEPreferencesFormattingViewController.m */, - AB30FF6A179C6AB400E49E0B /* CDEPreferencesFormattingViewController.xib */, - AB30FF6D179C6B1700E49E0B /* CDEPreferencesMiscViewController.h */, - AB30FF6E179C6B1700E49E0B /* CDEPreferencesMiscViewController.m */, - AB30FF6F179C6B1700E49E0B /* CDEPreferencesMiscViewController.xib */, + ABFFA4871DDF4784009BF96F /* PreferencesVC.h */, + ABFFA4881DDF4784009BF96F /* PreferencesVC.m */, ); name = "View Controllers"; sourceTree = ""; @@ -1029,15 +988,6 @@ name = "NSTableColumn Additions"; sourceTree = ""; }; - AB7EF6AF1DB4028D0062DD0C /* CDETests */ = { - isa = PBXGroup; - children = ( - AB7EF6B01DB4028D0062DD0C /* CDETests.swift */, - AB7EF6B21DB4028D0062DD0C /* Info.plist */, - ); - path = CDETests; - sourceTree = ""; - }; AB86F7C71791920A00FB0AEB /* Window Controller */ = { isa = PBXGroup; children = ( @@ -1077,6 +1027,36 @@ name = "Order Index Cell View"; sourceTree = ""; }; + AB98E86E1DDF40EB00925C8A /* General */ = { + isa = PBXGroup; + children = ( + AB30FF6D179C6B1700E49E0B /* PreferencesGeneralVC.h */, + AB30FF6E179C6B1700E49E0B /* PreferencesGeneralVC.m */, + AB98E86C1DDF405500925C8A /* PreferencesGeneral.storyboard */, + ); + name = General; + sourceTree = ""; + }; + AB98E86F1DDF40F900925C8A /* Integration */ = { + isa = PBXGroup; + children = ( + AB30FF63179C696D00E49E0B /* PreferencesIntegrationVC.h */, + AB30FF64179C696D00E49E0B /* PreferencesIntegrationVC.m */, + AB98E8701DDF413E00925C8A /* PreferencesIntegration.storyboard */, + ); + name = Integration; + sourceTree = ""; + }; + AB98E8741DDF41C600925C8A /* Formatting */ = { + isa = PBXGroup; + children = ( + AB98E8721DDF41A300925C8A /* PreferencesFormatting.storyboard */, + AB30FF68179C6AB400E49E0B /* PreferencesFormattingVC.h */, + AB30FF69179C6AB400E49E0B /* PreferencesFormattingVC.m */, + ); + name = Formatting; + sourceTree = ""; + }; AB99B2ED1998DCDC00101647 /* TinySQLite */ = { isa = PBXGroup; children = ( @@ -1195,7 +1175,6 @@ isa = PBXGroup; children = ( ABBEA7DF1765CB730024A9D2 /* Core Data Editor */, - AB7EF6AF1DB4028D0062DD0C /* CDETests */, ABBEA7D81765CB730024A9D2 /* Frameworks */, ABBEA7D71765CB730024A9D2 /* Products */, ); @@ -1205,7 +1184,6 @@ isa = PBXGroup; children = ( ABBEA7D61765CB730024A9D2 /* Core Data Editor.app */, - AB7EF6AE1DB4028C0062DD0C /* CDETests.xctest */, ); name = Products; sourceTree = ""; @@ -1244,6 +1222,7 @@ ABBEA7EC1765CB730024A9D2 /* CDEDocument.m */, ABBEA7EE1765CB730024A9D2 /* CDEDocument.xib */, ABBEA7F11765CB730024A9D2 /* MainMenu.xib */, + AB59DA3F1DDF42AA00A19963 /* Main.storyboard */, ABBEA7F41765CB730024A9D2 /* CDEDocument.xcdatamodeld */, ABBEA7E01765CB730024A9D2 /* Supporting Files */, ); @@ -1253,7 +1232,6 @@ ABBEA7E01765CB730024A9D2 /* Supporting Files */ = { isa = PBXGroup; children = ( - ABC83B0D17B1166300078580 /* mogenerator */, ABC1E6BB1777776B0069D252 /* Assets */, AB5583A4176751AE005C002C /* icon.iconset */, ABBEA8B91766153A0024A9D2 /* Localizable.strings */, @@ -1581,53 +1559,6 @@ path = Assets; sourceTree = ""; }; - ABC83B0D17B1166300078580 /* mogenerator */ = { - isa = PBXGroup; - children = ( - ABC83B1017B116A000078580 /* mogeneratorReadme.rtf */, - ABC83B0E17B1166300078580 /* mogenerator */, - ); - path = mogenerator; - sourceTree = ""; - }; - ABC83B1D17B1170C00078580 /* Code Generator */ = { - isa = PBXGroup; - children = ( - ABC83B1E17B11AE900078580 /* New Group */, - ABC83B1F17B11AEE00078580 /* Private */, - ); - name = "Code Generator"; - sourceTree = ""; - }; - ABC83B1E17B11AE900078580 /* New Group */ = { - isa = PBXGroup; - children = ( - ABC83B1217B1170900078580 /* CDECodeGenerator.h */, - ABC83B1317B1170900078580 /* CDECodeGenerator.m */, - ); - name = "New Group"; - sourceTree = ""; - }; - ABC83B1F17B11AEE00078580 /* Private */ = { - isa = PBXGroup; - children = ( - ABC83B2017B11AF200078580 /* View Controller */, - ABC83B1417B1170900078580 /* CDEManagedObjectSubclassesGenerator.h */, - ABC83B1517B1170900078580 /* CDEManagedObjectSubclassesGenerator.m */, - ); - name = Private; - sourceTree = ""; - }; - ABC83B2017B11AF200078580 /* View Controller */ = { - isa = PBXGroup; - children = ( - ABC83B1617B1170900078580 /* CDECodeGeneratorAccessoryViewController.h */, - ABC83B1717B1170900078580 /* CDECodeGeneratorAccessoryViewController.m */, - ABC83B1817B1170900078580 /* CDECodeGeneratorAccessoryViewController.xib */, - ); - name = "View Controller"; - sourceTree = ""; - }; ABC83B4A17B1213C00078580 /* About */ = { isa = PBXGroup; children = ( @@ -1837,10 +1768,10 @@ ABEB756B1776F35E00141062 /* Preferences Window Controller */ = { isa = PBXGroup; children = ( - ABEB756C1776F37100141062 /* CDEPreferencesWindowController.h */, - ABEB756D1776F37100141062 /* CDEPreferencesWindowController.m */, - ABEB756E1776F37100141062 /* CDEPreferencesWindowController.xib */, AB30FF73179C702900E49E0B /* View Controllers */, + AB98E86A1DDF3F5900925C8A /* Preferences.storyboard */, + AB59DA5E1DDF43FE00A19963 /* PreferencesWC.h */, + AB59DA5F1DDF43FE00A19963 /* PreferencesWC.m */, ); name = "Preferences Window Controller"; sourceTree = ""; @@ -2094,24 +2025,6 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - AB7EF6AD1DB4028C0062DD0C /* CDETests */ = { - isa = PBXNativeTarget; - buildConfigurationList = AB7EF6B51DB4028D0062DD0C /* Build configuration list for PBXNativeTarget "CDETests" */; - buildPhases = ( - AB7EF6AA1DB4028C0062DD0C /* Sources */, - AB7EF6AB1DB4028C0062DD0C /* Frameworks */, - AB7EF6AC1DB4028C0062DD0C /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - AB7EF6B41DB4028D0062DD0C /* PBXTargetDependency */, - ); - name = CDETests; - productName = CDETests; - productReference = AB7EF6AE1DB4028C0062DD0C /* CDETests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; ABBEA7D51765CB730024A9D2 /* Core Data Editor */ = { isa = PBXNativeTarget; buildConfigurationList = ABBEA7F91765CB730024A9D2 /* Build configuration list for PBXNativeTarget "Core Data Editor" */; @@ -2136,16 +2049,10 @@ isa = PBXProject; attributes = { CLASSPREFIX = CDE; - LastSwiftUpdateCheck = 0800; LastTestingUpgradeCheck = 0510; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0810; ORGANIZATIONNAME = "Christian Kienle"; TargetAttributes = { - AB7EF6AD1DB4028C0062DD0C = { - CreatedOnToolsVersion = 8.0; - ProvisioningStyle = Automatic; - TestTargetID = ABBEA7D51765CB730024A9D2; - }; ABBEA7D51765CB730024A9D2 = { DevelopmentTeam = 6YJV6LM6Q4; SystemCapabilities = { @@ -2169,19 +2076,11 @@ projectRoot = ""; targets = ( ABBEA7D51765CB730024A9D2 /* Core Data Editor */, - AB7EF6AD1DB4028C0062DD0C /* CDETests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - AB7EF6AC1DB4028C0062DD0C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; ABBEA7D41765CB730024A9D2 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2193,6 +2092,7 @@ ABBEA8261765D5AC0024A9D2 /* CDENewConfigurationSummaryViewController.xib in Resources */, ABBEA82B1765D5AC0024A9D2 /* CDEDropStoreViewController.xib in Resources */, ABBEA8301765D5AC0024A9D2 /* CDEModelChooserSheetController.xib in Resources */, + AB98E86B1DDF3F5900925C8A /* Preferences.storyboard in Resources */, ABBEA8361765D5AC0024A9D2 /* CDEDropApplicationViewController.xib in Resources */, ABBEA8381765D5AC0024A9D2 /* CDEConfigurationWizzard.xib in Resources */, ABBEA8BB1766153A0024A9D2 /* Localizable.strings in Resources */, @@ -2203,7 +2103,6 @@ AB3B07911775DCF6000855B0 /* CDEStringValueTableCellView.xib in Resources */, AB3B07CB1775FCF2000855B0 /* CDEBoolValueTableCellView.xib in Resources */, ABEB75661776E71600141062 /* CDEObjectIDValueTableCellView.xib in Resources */, - ABEB75701776F37100141062 /* CDEPreferencesWindowController.xib in Resources */, ABEB75A5177705EE00141062 /* CDEFloatingPointValueTableCellView.xib in Resources */, ABEB75AF17771ABE00141062 /* CDEBinaryValueTableCellView.xib in Resources */, ABC1E69B177731C20069D252 /* CDEDateValueTableCellView.xib in Resources */, @@ -2229,26 +2128,24 @@ ABDA4284181C068F0054A226 /* CDEManagedObjectsTableViewController.xib in Resources */, AB14671B1789D8FA00E3EEA3 /* CDEIntegerValueTableCellView.xib in Resources */, AB86F7CC1791922600FB0AEB /* CDEAttributeEditorWindowController.xib in Resources */, - AB30FF67179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.xib in Resources */, - AB30FF6C179C6AB400E49E0B /* CDEPreferencesFormattingViewController.xib in Resources */, - AB30FF71179C6B1700E49E0B /* CDEPreferencesMiscViewController.xib in Resources */, AB2D343617A04CCD00A1B0CA /* CDETextEditorViewController.xib in Resources */, ABDF8AF317A41FA600727346 /* CDECSVAccessoryViewController.xib in Resources */, ABDF8AF417A41FA600727346 /* CDECSVImportWindow.xib in Resources */, ABDF4F0317A4622F0030755B /* EditTemplate.png in Resources */, + AB59DA401DDF42AA00A19963 /* Main.storyboard in Resources */, + AB98E86D1DDF405500925C8A /* PreferencesGeneral.storyboard in Resources */, ABDF4F0417A4622F0030755B /* EditTemplate@2x.png in Resources */, + AB98E8731DDF41A300925C8A /* PreferencesFormatting.storyboard in Resources */, AB23E43017A6AE08001C19A7 /* code-icon.png in Resources */, AB23E43117A6AE08001C19A7 /* code-icon@2x.png in Resources */, AB23E43217A6AE08001C19A7 /* csv-icon.png in Resources */, AB23E43317A6AE08001C19A7 /* csv-icon@2x.png in Resources */, AB23E43617A6B0FB001C19A7 /* formatting-icon.png in Resources */, + AB98E8711DDF413E00925C8A /* PreferencesIntegration.storyboard in Resources */, AB23E43717A6B0FB001C19A7 /* formatting-icon@2x.png in Resources */, AB23E43A17A6B9CA001C19A7 /* integration-icon.png in Resources */, AB23E43B17A6B9CA001C19A7 /* integration-icon@2x.png in Resources */, - ABC83B0F17B1166300078580 /* mogenerator in Resources */, ABDA422F181BFF2C0054A226 /* CDEMenuViewController.xib in Resources */, - ABC83B1117B116A000078580 /* mogeneratorReadme.rtf in Resources */, - ABC83B1C17B1170900078580 /* CDECodeGeneratorAccessoryViewController.xib in Resources */, ABC83B4F17B1215200078580 /* CDEAboutWindowController.xib in Resources */, ABC83BDE17B24D9600078580 /* Document_Icon.iconset in Resources */, ABB225D817B92B230024FE4F /* CDEProjectBrowserWindowController.xib in Resources */, @@ -2262,14 +2159,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - AB7EF6AA1DB4028C0062DD0C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AB7EF6B11DB4028D0062DD0C /* CDETests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; ABBEA7D21765CB730024A9D2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2287,12 +2176,14 @@ ABBEA82F1765D5AC0024A9D2 /* CDEModelChooserSheetController.m in Sources */, ABBEA8351765D5AC0024A9D2 /* CDEDropApplicationViewController.m in Sources */, ABBEA8371765D5AC0024A9D2 /* CDEConfigurationWizzard.m in Sources */, + ABFFA4891DDF4784009BF96F /* PreferencesVC.m in Sources */, ABBEA83D1765D6260024A9D2 /* CDEDropZoneView.m in Sources */, ABBEA8401765D6D70024A9D2 /* NSError-CDEAdditions.m in Sources */, ABBEA8461765D7250024A9D2 /* NSManagedObjectModel-CDEAdditions.m in Sources */, ABBEA88D1765EA680024A9D2 /* NSDictionary+CDEInfoDictionaryAdditions.m in Sources */, ABCFAF031815826D0011D6FB /* NSPersistentStoreCoordinator+CDEAdditions.m in Sources */, ABBEA8911765EFE40024A9D2 /* NSPersistentStore+CDEStoreAnalyzer.m in Sources */, + AB59DA601DDF43FE00A19963 /* PreferencesWC.m in Sources */, ABBEA8951765F3320024A9D2 /* NSBundle+CDEApplicationAnalyzer.m in Sources */, ABBEA8A01765FC230024A9D2 /* NSURL+CDEApplicationAnalyzer.m in Sources */, ABBEA8A4176602B60024A9D2 /* NSString+CDEPersistentStore.m in Sources */, @@ -2311,7 +2202,6 @@ ABEB75641776E70900141062 /* CDEObjectIDValueTableCellView.m in Sources */, ABEB75691776E75800141062 /* CDEManagedObjectIDToStringValueTransformer.m in Sources */, AB99B2EF1998DD0400101647 /* SQLiteDatabase.m in Sources */, - ABEB756F1776F37100141062 /* CDEPreferencesWindowController.m in Sources */, ABEB75731776F61300141062 /* NSUserDefaults+CDEAdditions.m in Sources */, ABEB75A3177705E100141062 /* CDEFloatingPointValueTableCellView.m in Sources */, ABEB75A917770B8900141062 /* NSAttributeDescription+CDEAdditions.m in Sources */, @@ -2379,15 +2269,14 @@ AB86F7CB1791922600FB0AEB /* CDEAttributeEditorWindowController.m in Sources */, ABBB31E217984AC100FE964E /* CDENameToNameForDisplayValueTransformer.m in Sources */, ABBB322A1798538100FE964E /* NSError+CDEValidation.m in Sources */, - AB7F20CE19DD7B4D00EBBF52 /* VibrantView.m in Sources */, ABBB322E179855D500FE964E /* NSManagedObject+CDEAdditions.m in Sources */, ABBB32321798564100FE964E /* NSManagedObjectContext+CDEAdditions.m in Sources */, AB531222179953B300529EF7 /* NSTableColumn+CDERequestDataCoordinator.m in Sources */, ABFBB3B1179C36E2003B5346 /* CDETwoColumnSplitViewController.m in Sources */, AB0181171997C805000FE094 /* NSDirectoryEnumerator+ProjectBrowser.m in Sources */, - AB30FF66179C696D00E49E0B /* CDEPreferencesAutomaticProjectCreationViewController.m in Sources */, - AB30FF6B179C6AB400E49E0B /* CDEPreferencesFormattingViewController.m in Sources */, - AB30FF70179C6B1700E49E0B /* CDEPreferencesMiscViewController.m in Sources */, + AB30FF66179C696D00E49E0B /* PreferencesIntegrationVC.m in Sources */, + AB30FF6B179C6AB400E49E0B /* PreferencesFormattingVC.m in Sources */, + AB30FF70179C6B1700E49E0B /* PreferencesGeneralVC.m in Sources */, ABDA428D181C0D870054A226 /* BFNavigationController.m in Sources */, ABDA422D181BFF2C0054A226 /* CDEMenuViewController.m in Sources */, ABBAF36D179FFBD200179732 /* CHCSVParser.m in Sources */, @@ -2406,9 +2295,6 @@ AB23E43F17A6C231001C19A7 /* CDEAutosaveInformation.m in Sources */, AB23E44417A6CBA8001C19A7 /* CDEEntityAutosaveInformationItem.m in Sources */, AB23E44717A6CBB3001C19A7 /* CDEEntityAutosaveInformation.m in Sources */, - ABC83B1917B1170900078580 /* CDECodeGenerator.m in Sources */, - ABC83B1A17B1170900078580 /* CDEManagedObjectSubclassesGenerator.m in Sources */, - ABC83B1B17B1170900078580 /* CDECodeGeneratorAccessoryViewController.m in Sources */, ABC83B4E17B1215200078580 /* CDEAboutWindowController.m in Sources */, ABDA4231181BFF2C0054A226 /* CDEMenuView.m in Sources */, ABB225D317B922FA0024FE4F /* CDEPathPickerPopUpButton.m in Sources */, @@ -2421,14 +2307,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - AB7EF6B41DB4028D0062DD0C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = ABBEA7D51765CB730024A9D2 /* Core Data Editor */; - targetProxy = AB7EF6B31DB4028D0062DD0C /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ ABBEA7E21765CB730024A9D2 /* InfoPlist.strings */ = { isa = PBXVariantGroup; @@ -2473,78 +2351,6 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - AB7EF6B61DB4028D0062DD0C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ENABLE_MODULES = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVES = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CODE_SIGN_IDENTITY = "-"; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - INFOPLIST_FILE = CDETests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_BUNDLE_IDENTIFIER = "de.christian-kienle.CDETests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Core Data Editor.app/Contents/MacOS/Core Data Editor"; - }; - name = Debug; - }; - AB7EF6B71DB4028D0062DD0C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ENABLE_MODULES = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVES = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CODE_SIGN_IDENTITY = "-"; - COMBINE_HIDPI_IMAGES = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - INFOPLIST_FILE = CDETests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = "de.christian-kienle.CDETests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Core Data Editor.app/Contents/MacOS/Core Data Editor"; - }; - name = Release; - }; ABBEA7F71765CB730024A9D2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2578,7 +2384,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; @@ -2614,9 +2420,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.10; SDKROOT = macosx; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; @@ -2628,11 +2433,10 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Core Data Editor/Core Data Editor-Prefix.pch"; INFOPLIST_FILE = "Core Data Editor/Core Data Editor-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = "de.christian-kienle.coredataeditor5"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; - SDKROOT = macosx; WRAPPER_EXTENSION = app; }; name = Debug; @@ -2646,11 +2450,10 @@ GCC_PREFIX_HEADER = "Core Data Editor/Core Data Editor-Prefix.pch"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "Core Data Editor/Core Data Editor-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = "de.christian-kienle.coredataeditor5"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; - SDKROOT = macosx; WRAPPER_EXTENSION = app; }; name = Release; @@ -2658,15 +2461,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - AB7EF6B51DB4028D0062DD0C /* Build configuration list for PBXNativeTarget "CDETests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AB7EF6B61DB4028D0062DD0C /* Debug */, - AB7EF6B71DB4028D0062DD0C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; ABBEA7D11765CB730024A9D2 /* Build configuration list for PBXProject "Core Data Editor" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Core Data Editor/Core Data Editor/CDEAboutWindowController.h b/Core Data Editor/Core Data Editor/CDEAboutWindowController.h index 5353c05..fa4556b 100644 --- a/Core Data Editor/Core Data Editor/CDEAboutWindowController.h +++ b/Core Data Editor/Core Data Editor/CDEAboutWindowController.h @@ -1,11 +1,3 @@ -// -// CDEAboutWindowController.h -// Core Data Editor -// -// Created by cmk on 8/6/13. -// Copyright (c) 2013 Christian Kienle. All rights reserved. -// - #import @interface CDEAboutWindowController : NSWindowController diff --git a/Core Data Editor/Core Data Editor/CDEAboutWindowController.m b/Core Data Editor/Core Data Editor/CDEAboutWindowController.m index d9513eb..6c4c5ff 100644 --- a/Core Data Editor/Core Data Editor/CDEAboutWindowController.m +++ b/Core Data Editor/Core Data Editor/CDEAboutWindowController.m @@ -1,19 +1,18 @@ #import "CDEAboutWindowController.h" @interface CDEAboutWindowController () + @property (unsafe_unretained) IBOutlet NSTextView *textView; @end @implementation CDEAboutWindowController -- (void)windowDidLoad -{ - [super windowDidLoad]; - NSURL *aboutURL = [[NSBundle mainBundle] URLForResource:@"Credits" withExtension:@"rtf"]; - NSDictionary *options = @{ NSDocumentTypeDocumentOption : NSRTFTextDocumentType}; - NSAttributedString *aboutText = [[NSAttributedString alloc] initWithURL:aboutURL options:options documentAttributes:nil error:NULL]; - [[self.textView textStorage] appendAttributedString:aboutText]; +- (void)windowDidLoad { + [super windowDidLoad]; + NSURL *aboutURL = [[NSBundle mainBundle] URLForResource:@"Credits" withExtension:@"rtf"]; + NSAttributedString *aboutText = [[NSAttributedString alloc] initWithURL:aboutURL options:@{} documentAttributes:NULL error:NULL]; + [[self.textView textStorage] appendAttributedString:aboutText]; } @end diff --git a/Core Data Editor/Core Data Editor/CDEAboutWindowController.xib b/Core Data Editor/Core Data Editor/CDEAboutWindowController.xib index c8b65df..c88d117 100644 --- a/Core Data Editor/Core Data Editor/CDEAboutWindowController.xib +++ b/Core Data Editor/Core Data Editor/CDEAboutWindowController.xib @@ -1,507 +1,85 @@ - - - 1080 - 12E55 - 3084 - 1187.39 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 3084 - - - NSCustomObject - NSImageCell - NSImageView - NSScrollView - NSScroller - NSTextField - NSTextFieldCell - NSTextView - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - CDEAboutWindowController - - - FirstResponder - - - NSApplication - - - 3 - 2 - {{196, 240}, {380, 328}} - 1618477056 - - NSWindow - - - - - 256 - - - - 274 - - - - 2304 - - - - 2322 - {380, 165} - - - - _NS:13 - - - - - - - - - - - - 166 - - - - 380 - 1 - - - 12261 - 0 - - - 3 - MQA - - - - 6 - System - selectedTextBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - selectedTextColor - - 3 - MAA - - - - - - - 1 - MCAwIDEAA - - - {8, -8} - 13 - - - - - - 1 - - 6 - {463, 10000000} - - - - {{1, 1}, {380, 165}} - - - - _NS:11 - - - - {4, 5} - - 79691776 - - - - - - file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff - - - - - 3 - MCAwAA - - - - 4 - - - - 256 - {{365, 1}, {16, 165}} - - - - _NS:83 - NO - - _doScroller: - 0.99259259259259258 - - - - -2147483392 - {{-100, -100}, {87, 18}} - - - - _NS:33 - NO - 1 - - _doScroller: - 1 - 0.94565218687057495 - - - {{-1, 45}, {382, 167}} - - - - _NS:9 - 133138 - - - - 0.25 - 4 - 1 - - - - 256 - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {{157, 241}, {67, 67}} - - - - YES - - 0 - 33554432 - - NSImage - NSApplicationIcon - - 0 - 0 - 0 - YES - - NO - YES - - - - 268 - {{17, 20}, {346, 17}} - - - - _NS:1535 - YES - - 68157504 - 138413056 - © Thermal Core, 2013 - - LucidaGrande - 13 - 1044 - - _NS:1535 - - - 6 - System - controlColor - - - - 6 - System - controlTextColor - - - - NO - - - - 268 - {{17, 220}, {346, 17}} - - - - _NS:1535 - YES - - 68157504 - 138413056 - Core Data Editor - - LucidaGrande-Bold - 13 - 2072 - - _NS:1535 - - - - - NO - - - {380, 328} - - - - - {{0, 0}, {1920, 1058}} - {10000000000000, 10000000000000} - NO - - - - - - - window - - - - 3 - - - - textView - - - - 37 - - - - delegate - - - - 4 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - - - - - - - - - 5 - - - - - - - - - - 6 - - - - - 7 - - - - - 8 - - - - - 13 - - - - - - - - 14 - - - - - 25 - - - - - - - - 26 - - - - - 35 - - - - - - - - 36 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - {{357, 418}, {480, 270}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 37 - - - - - CDEAboutWindowController - NSWindowController - - textView - NSTextView - - - textView - - textView - NSTextView - - - - IBProjectSource - ./Classes/CDEAboutWindowController.h - - - - - 0 - IBCocoaFramework - YES - 3 - - NSApplicationIcon - {128, 128} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core Data Editor/Core Data Editor/CDEApplicationDelegate.m b/Core Data Editor/Core Data Editor/CDEApplicationDelegate.m index a3ac826..5f1b052 100644 --- a/Core Data Editor/Core Data Editor/CDEApplicationDelegate.m +++ b/Core Data Editor/Core Data Editor/CDEApplicationDelegate.m @@ -1,5 +1,4 @@ #import "CDEApplicationDelegate.h" -#import "CDEPreferencesWindowController.h" #import "CDENSNullToNilTransformer.h" #import "CDENameToNameForDisplayValueTransformer.h" #import "NSPersistentStore+CDEStoreAnalyzer.h" @@ -9,7 +8,7 @@ #import "NSWorkspace+CDEAdditions.h" #import "CDEProjectBrowserWindowController.h" #import "CDESetupWindowController.h" - +#import "PreferencesWC.h" @interface CDEApplicationDelegate () #pragma mark - Helper / Security Scoped Resources @@ -17,7 +16,6 @@ @interface CDEApplicationDelegate () @property (nonatomic, copy) NSURL *derivedDataDirectory; #pragma mark - Properties -@property (nonatomic, strong) CDEPreferencesWindowController *preferencesWindowController; @property (nonatomic, strong) CDEAboutWindowController *aboutWindowController; @property (nonatomic, strong) CDEProjectBrowserWindowController *projectBrowserWindowController; @property (nonatomic, strong) CDESetupWindowController *setupWindowController; @@ -27,204 +25,208 @@ @interface CDEApplicationDelegate () @implementation CDEApplicationDelegate + (void)initialize { - if(self == [CDEApplicationDelegate class]) { - [NSUserDefaults registerCoreDataEditorDefaults_cde]; - [NSValueTransformer setValueTransformer:[CDENSNullToNilTransformer new] forName:@"CDENSNullToNilTransformer"]; - [CDENameToNameForDisplayValueTransformer registerDefaultCoreDataEditorNameToNameForDisplayValueTransformer]; - } + if(self == [CDEApplicationDelegate class]) { + [NSUserDefaults registerCoreDataEditorDefaults_cde]; + [NSValueTransformer setValueTransformer:[CDENSNullToNilTransformer new] forName:@"CDENSNullToNilTransformer"]; + [CDENameToNameForDisplayValueTransformer registerDefaultCoreDataEditorNameToNameForDisplayValueTransformer]; + } } #pragma mark - Actions - (IBAction)showPreferences:(id)sender { - [self.preferencesWindowController showWithCompletionHandler:^{ - }]; + PreferencesWC *vc = [[NSStoryboard storyboardWithName:@"Preferences" bundle:nil] instantiateInitialController]; + [vc showWindow:nil]; + //cde.showPreferences } - (IBAction)showAbout:(id)sender { - [self.aboutWindowController showWindow:self]; + [self.aboutWindowController showWindow:self]; } - (IBAction)showHelp:(id)sender { - [[NSWorkspace sharedWorkspace] openSupportWebsite_cde]; + [[NSWorkspace sharedWorkspace] openSupportWebsite_cde]; } - (IBAction)showProjectBrowser:(id)sender { - if(self.projectBrowserWindowController == nil) { - self.projectBrowserWindowController = [CDEProjectBrowserWindowController new]; - } - [self.projectBrowserWindowController showWithProjectDirectoryURL:self.iPhoneSimulatorDirectory]; + if(self.projectBrowserWindowController == nil) { + self.projectBrowserWindowController = [CDEProjectBrowserWindowController new]; + } + [self.projectBrowserWindowController showWithProjectDirectoryURL:self.iPhoneSimulatorDirectory]; } #pragma mark - Helper #pragma mark - Helper / Security Scoped Resources - (BOOL)startAccessingCoreDataEditorSecurityScopedResources { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - - BOOL iPhoneSimulatorSuccess = YES; - - if(defaults.simulatorDirectory_cde != nil) { - self.iPhoneSimulatorDirectory = defaults.simulatorDirectory_cde; - iPhoneSimulatorSuccess = [self.iPhoneSimulatorDirectory startAccessingSecurityScopedResource]; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + BOOL iPhoneSimulatorSuccess = YES; + + if(defaults.simulatorDirectory_cde != nil) { + self.iPhoneSimulatorDirectory = defaults.simulatorDirectory_cde; + iPhoneSimulatorSuccess = [self.iPhoneSimulatorDirectory startAccessingSecurityScopedResource]; + } + + BOOL buildProductsDirectorySuccess = YES; + + if(defaults.buildProductsDirectory_cde != nil) { + self.derivedDataDirectory = defaults.buildProductsDirectory_cde; + buildProductsDirectorySuccess = [self.derivedDataDirectory startAccessingSecurityScopedResource]; + if(buildProductsDirectorySuccess == NO) { + // we have bookmark data but we cannot start accessing it! + NSAlert *alert = [NSAlert new]; + alert.messageText = @"Failed to access Derived Data Directory"; + [alert addButtonWithTitle:@"Set Directory…"]; + [alert addButtonWithTitle:@"Cancel"]; + alert.informativeText = @"You have set a Xcode derived data directory in the preferences but Core Data Editor failed to access the contents of the directory. If you want to continue to use this feature you should set a new directory now."; + NSUInteger returnCode = [alert runModal]; + if(returnCode == NSAlertFirstButtonReturn) { + assert(false); +// [self.preferencesWindowController showAutomaticProjectCreationPreferencesWithCompletionHandler:nil]; + } } - - BOOL buildProductsDirectorySuccess = YES; - - if(defaults.buildProductsDirectory_cde != nil) { - self.derivedDataDirectory = defaults.buildProductsDirectory_cde; - buildProductsDirectorySuccess = [self.derivedDataDirectory startAccessingSecurityScopedResource]; - if(buildProductsDirectorySuccess == NO) { - // we have bookmark data but we cannot start accessing it! - NSAlert *alert = [NSAlert new]; - alert.messageText = @"Failed to access Derived Data Directory"; - [alert addButtonWithTitle:@"Set Directory…"]; - [alert addButtonWithTitle:@"Cancel"]; - alert.informativeText = @"You have set a Xcode derived data directory in the preferences but Core Data Editor failed to access the contents of the directory. If you want to continue to use this feature you should set a new directory now."; - NSUInteger returnCode = [alert runModal]; - if(returnCode == NSAlertFirstButtonReturn) { - [self.preferencesWindowController showAutomaticProjectCreationPreferencesWithCompletionHandler:nil]; - } - } - } - - return (iPhoneSimulatorSuccess && buildProductsDirectorySuccess); + } + + return (iPhoneSimulatorSuccess && buildProductsDirectorySuccess); } #pragma mark NSApplicationDelegate - (void)applicationWillFinishLaunching:(NSNotification *)notification { - - // Start accessing security scoped resources here because this delegate method is called - // before applicationDidFinishLaunching: and before application:openFile: - // Since we need access to the resources in both cases... - [self startAccessingCoreDataEditorSecurityScopedResources]; - - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + // Start accessing security scoped resources here because this delegate method is called + // before applicationDidFinishLaunching: and before application:openFile: + // Since we need access to the resources in both cases... + [self startAccessingCoreDataEditorSecurityScopedResources]; + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:@"HELLO" forKey:@"AAAAAAAAAAAAAA"]; - [[NSNotificationCenter defaultCenter] addObserverForName:CDEUserDefaultsNotifications.didChangeSimulatorDirectory object:defaults queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { - [self.iPhoneSimulatorDirectory stopAccessingSecurityScopedResource]; - self.iPhoneSimulatorDirectory = defaults.simulatorDirectory_cde; - [self.iPhoneSimulatorDirectory startAccessingSecurityScopedResource]; - [self.projectBrowserWindowController updateProjectDirectoryURL:self.iPhoneSimulatorDirectory]; - }]; - - [[NSNotificationCenter defaultCenter] addObserverForName:CDEUserDefaultsNotifications.didChangeBuildProductsDirectory object:defaults queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { - [self.derivedDataDirectory stopAccessingSecurityScopedResource]; - self.derivedDataDirectory = defaults.buildProductsDirectory_cde; - [self.derivedDataDirectory startAccessingSecurityScopedResource]; - }]; + [[NSNotificationCenter defaultCenter] addObserverForName:CDEUserDefaultsNotifications.didChangeSimulatorDirectory object:defaults queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + [self.iPhoneSimulatorDirectory stopAccessingSecurityScopedResource]; + self.iPhoneSimulatorDirectory = defaults.simulatorDirectory_cde; + [self.iPhoneSimulatorDirectory startAccessingSecurityScopedResource]; + [self.projectBrowserWindowController updateProjectDirectoryURL:self.iPhoneSimulatorDirectory]; + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:CDEUserDefaultsNotifications.didChangeBuildProductsDirectory object:defaults queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + [self.derivedDataDirectory stopAccessingSecurityScopedResource]; + self.derivedDataDirectory = defaults.buildProductsDirectory_cde; + [self.derivedDataDirectory startAccessingSecurityScopedResource]; + }]; } - (void)applicationDidFinishLaunching:(NSNotification *)notification { - - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - if(defaults.applicationNeedsSetup_cde) { - self.setupWindowController = [CDESetupWindowController new]; - [self.setupWindowController showWindow:self]; - } - else if (defaults.opensProjectBrowserOnLaunch_cde) { - [self showProjectBrowser:nil]; - - } + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + if(defaults.applicationNeedsSetup_cde) { + self.setupWindowController = [CDESetupWindowController new]; + [self.setupWindowController showWindow:self]; + } + else if (defaults.opensProjectBrowserOnLaunch_cde) { + [self showProjectBrowser:nil]; - self.aboutWindowController = [[CDEAboutWindowController alloc] initWithWindowNibName:@"CDEAboutWindowController"]; - // Create prefs if needed - if(self.preferencesWindowController == nil) { - self.preferencesWindowController = [CDEPreferencesWindowController new]; - } + } + + self.aboutWindowController = [[CDEAboutWindowController alloc] initWithWindowNibName:@"CDEAboutWindowController"]; + // Create prefs if needed +// if(self.preferencesWindowController == nil) { +// self.preferencesWindowController = [CDEPreferencesWindowController new]; +// } } - (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - if(!flag && defaults.opensProjectBrowserOnLaunch_cde) { - [self showProjectBrowser:nil]; - return NO; - } - return YES; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + if(!flag && defaults.opensProjectBrowserOnLaunch_cde) { + [self showProjectBrowser:nil]; + return NO; + } + return YES; } - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender { - return NO; + return NO; } - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { - // Need to create prefs? - if(self.preferencesWindowController == nil) { - self.preferencesWindowController = [CDEPreferencesWindowController new]; + // Need to create prefs? +// if(self.preferencesWindowController == nil) { +// self.preferencesWindowController = [CDEPreferencesWindowController new]; +// } + if([filename.pathExtension isEqualToString:@"coredataeditor5"]) { + [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:[NSURL fileURLWithPath:filename] display:YES completionHandler:^(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error) { + + }]; + return YES; + } + // Is this a store file? + NSURL *storeURL = [NSURL fileURLWithPath:filename]; + + NSString *storeType = [NSPersistentStore typeOfPersistentStoreAtURL_cde:storeURL]; + if(storeType == nil) { + NSLog(@"'%@' not a valid store", filename); + return NO; + } + // If we have no build products URL we can return NO + NSURL *buildProductsDirectory = [[NSUserDefaults standardUserDefaults] buildProductsDirectory_cde]; + if(buildProductsDirectory == nil) { + NSLog(@"no build products directory."); + assert(false); +#pragma mark warn bla +// [self.preferencesWindowController showAutomaticProjectCreationPreferencesAndDisplayInfoSheetWithCompletionHandler:nil]; + return YES; + } + + // Try to find a matching model + NSFileManager *fileManager = [NSFileManager new]; + NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:buildProductsDirectory includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles errorHandler:^BOOL(NSURL *url, NSError *error) { + NSLog(@"error while enumerating contents of build products directory: %@", error); + return YES; + }]; + + NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; + + for(NSURL *potentialModelURL in enumerator) { + NSError *error = nil; + NSString *UTI = [workspace typeOfFile:potentialModelURL.path error:&error]; + if(UTI == nil) { + NSLog(@"Failed to determine UTI: %@", error); + continue; } - if([filename.pathExtension isEqualToString:@"coredataeditor5"]) { - [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:[NSURL fileURLWithPath:filename] display:YES completionHandler:^(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error) { - - }]; - return YES; + BOOL conformsTo = [workspace type:UTI conformsToType:@"com.apple.xcode.mom"]; + if(!conformsTo) { + continue; } - // Is this a store file? - NSURL *storeURL = [NSURL fileURLWithPath:filename]; - - NSString *storeType = [NSPersistentStore typeOfPersistentStoreAtURL_cde:storeURL]; - if(storeType == nil) { - NSLog(@"'%@' not a valid store", filename); - return NO; + + // We have found a model! + NSURL *modelURL = potentialModelURL; + NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; + NSManagedObjectModel *transformedModel = model.transformedManagedObjectModel_cde; + + // Test compatibility + error = nil; + BOOL isCompatible = [transformedModel isCompatibleWithStoreAtURL:storeURL error_cde:&error]; + if(!isCompatible) { + continue; } - // If we have no build products URL we can return NO - NSURL *buildProductsDirectory = [[NSUserDefaults standardUserDefaults] buildProductsDirectory_cde]; - if(buildProductsDirectory == nil) { - NSLog(@"no build products directory."); - [self.preferencesWindowController showAutomaticProjectCreationPreferencesAndDisplayInfoSheetWithCompletionHandler:nil]; - return YES; + error = nil; + + // We have found something! + NSLog(@"%@ is compatible with %@", storeURL.lastPathComponent, modelURL); + CDEDocument *document = [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:NO error:NULL]; + CDEConfiguration *c = [document createConfiguration]; + error = nil; + BOOL set = [c setBookmarkDataWithApplicationBundleURL:nil storeURL:storeURL modelURL:modelURL error:&error]; + if(!set) { + NSLog(@"error: %@", error); } - - // Try to find a matching model - NSFileManager *fileManager = [NSFileManager new]; - NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:buildProductsDirectory includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles errorHandler:^BOOL(NSURL *url, NSError *error) { - NSLog(@"error while enumerating contents of build products directory: %@", error); - return YES; - }]; - - NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; - - for(NSURL *potentialModelURL in enumerator) { - NSError *error = nil; - NSString *UTI = [workspace typeOfFile:potentialModelURL.path error:&error]; - if(UTI == nil) { - NSLog(@"Failed to determine UTI: %@", error); - continue; - } - BOOL conformsTo = [workspace type:UTI conformsToType:@"com.apple.xcode.mom"]; - if(!conformsTo) { - continue; - } - - // We have found a model! - NSURL *modelURL = potentialModelURL; - NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; - NSManagedObjectModel *transformedModel = model.transformedManagedObjectModel_cde; - - // Test compatibility - error = nil; - BOOL isCompatible = [transformedModel isCompatibleWithStoreAtURL:storeURL error_cde:&error]; - if(!isCompatible) { - continue; - } - error = nil; - - // We have found something! - NSLog(@"%@ is compatible with %@", storeURL.lastPathComponent, modelURL); - CDEDocument *document = [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:NO error:NULL]; - CDEConfiguration *c = [document createConfiguration]; - error = nil; - BOOL set = [c setBookmarkDataWithApplicationBundleURL:nil storeURL:storeURL modelURL:modelURL error:&error]; - if(!set) { - NSLog(@"error: %@", error); - } - error = nil; - BOOL setup = [document setupAndStartAccessingConfigurationRelatedURLsAndGetError:&error]; - if(!setup) { - NSLog(@"error: %@", error); - } - [document makeWindowControllers]; - [document showWindows]; - return YES; + error = nil; + BOOL setup = [document setupAndStartAccessingConfigurationRelatedURLsAndGetError:&error]; + if(!setup) { + NSLog(@"error: %@", error); } - return NO; + [document makeWindowControllers]; + [document showWindows]; + return YES; + } + return NO; } @end diff --git a/Core Data Editor/Core Data Editor/CDEAttributeEditor.m b/Core Data Editor/Core Data Editor/CDEAttributeEditor.m index 95ffb3c..a2d276e 100644 --- a/Core Data Editor/Core Data Editor/CDEAttributeEditor.m +++ b/Core Data Editor/Core Data Editor/CDEAttributeEditor.m @@ -37,13 +37,14 @@ - (void)showEditorForManagedObject:(NSManagedObject *)managedObject self.completionHandler = nil; }]; } + #pragma mark - Closing the Editor - (BOOL)isShown { return (self.windowController != nil); } - (void)close { - [NSApp endSheet:self.windowController.window]; + [self.windowController.window.sheetParent endSheet:self.windowController.window returnCode:NSModalResponseOK]; } @end diff --git a/Core Data Editor/Core Data Editor/CDEAttributeEditorViewController.xib b/Core Data Editor/Core Data Editor/CDEAttributeEditorViewController.xib index 639d96f..1f07882 100644 --- a/Core Data Editor/Core Data Editor/CDEAttributeEditorViewController.xib +++ b/Core Data Editor/Core Data Editor/CDEAttributeEditorViewController.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDEAttributeEditorWindowController.m b/Core Data Editor/Core Data Editor/CDEAttributeEditorWindowController.m index 1f571f6..0616520 100644 --- a/Core Data Editor/Core Data Editor/CDEAttributeEditorWindowController.m +++ b/Core Data Editor/Core Data Editor/CDEAttributeEditorWindowController.m @@ -45,7 +45,7 @@ - (void)windowDidLoad { } - (IBAction)performClose:(id)sender { - [NSApp endSheet:self.window]; + [self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK]; } @end diff --git a/Core Data Editor/Core Data Editor/CDEBinaryAttributeView.xib b/Core Data Editor/Core Data Editor/CDEBinaryAttributeView.xib index 8af996f..6a17e64 100644 --- a/Core Data Editor/Core Data Editor/CDEBinaryAttributeView.xib +++ b/Core Data Editor/Core Data Editor/CDEBinaryAttributeView.xib @@ -1,7 +1,6 @@ - @@ -39,7 +38,7 @@ - + @@ -105,7 +104,7 @@ - + diff --git a/Core Data Editor/Core Data Editor/CDEBinaryValuePreviewView.m b/Core Data Editor/Core Data Editor/CDEBinaryValuePreviewView.m index c26a1f7..dc5671b 100644 --- a/Core Data Editor/Core Data Editor/CDEBinaryValuePreviewView.m +++ b/Core Data Editor/Core Data Editor/CDEBinaryValuePreviewView.m @@ -76,11 +76,6 @@ - (void)drawRect:(NSRect)dirtyRect { actionImageOrigin.x = NSMidX(boxRect) - (0.5 * actionSize.width); actionImageOrigin.y = NSMidY(boxRect) - (0.5 * actionSize.height); [NSGraphicsContext saveGraphicsState]; -// NSShadow *shadow = [NSShadow new]; -// [shadow setShadowBlurRadius:0.0]; -// [shadow setShadowColor:[NSColor whiteColor]]; -// [shadow setShadowOffset:NSMakeSize(0.0, -1.5)]; -// [shadow set]; [actionImage drawAtPoint:actionImageOrigin fromRect:NSZeroRect operation:NSCompositingOperationSourceAtop fraction:1.0]; [NSGraphicsContext restoreGraphicsState]; diff --git a/Core Data Editor/Core Data Editor/CDEBooleanAttributeView.xib b/Core Data Editor/Core Data Editor/CDEBooleanAttributeView.xib index 2d88219..0de40a4 100644 --- a/Core Data Editor/Core Data Editor/CDEBooleanAttributeView.xib +++ b/Core Data Editor/Core Data Editor/CDEBooleanAttributeView.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDECSVAccessoryViewController.m b/Core Data Editor/Core Data Editor/CDECSVAccessoryViewController.m index 3aed091..ffce9f5 100644 --- a/Core Data Editor/Core Data Editor/CDECSVAccessoryViewController.m +++ b/Core Data Editor/Core Data Editor/CDECSVAccessoryViewController.m @@ -20,9 +20,7 @@ - (instancetype)init { - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if(self) { - - } + if(self) { } return self; } diff --git a/Core Data Editor/Core Data Editor/CDECSVAccessoryViewController.xib b/Core Data Editor/Core Data Editor/CDECSVAccessoryViewController.xib index fb7e6a5..0c3067d 100644 --- a/Core Data Editor/Core Data Editor/CDECSVAccessoryViewController.xib +++ b/Core Data Editor/Core Data Editor/CDECSVAccessoryViewController.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDECSVDelimiter.m b/Core Data Editor/Core Data Editor/CDECSVDelimiter.m index 6ec6a06..a6be68d 100644 --- a/Core Data Editor/Core Data Editor/CDECSVDelimiter.m +++ b/Core Data Editor/Core Data Editor/CDECSVDelimiter.m @@ -9,7 +9,7 @@ @interface CDECSVDelimiter () #pragma mark Getting Delimiter Instances -+ (NSDictionary *)delimiterStringValueForMenuItemTagMapping; ++ (NSDictionary *)delimiterStringValueForMenuItemTagMapping; #pragma mark Creating - (id)initWithStringRepresentation:(NSString *)stringRepresentation_ menuItemTag:(NSInteger)menuItemTag_; @@ -23,7 +23,7 @@ - (id)initWithStringRepresentation:(NSString *)stringRepresentation_ menuItemTag @implementation CDECSVDelimiter #pragma mark Getting Delimiter Instances -+ (NSDictionary *)delimiterStringValueForMenuItemTagMapping { ++ (NSDictionary *)delimiterStringValueForMenuItemTagMapping { NSMutableDictionary *result = [NSMutableDictionary dictionary]; result[@(CDECSVDelimiterMenuItemTagComma)] = @","; result[@(CDECSVDelimiterMenuItemTagSemicolon)] = @";"; diff --git a/Core Data Editor/Core Data Editor/CDECSVImportWindow.xib b/Core Data Editor/Core Data Editor/CDECSVImportWindow.xib index 91d5708..772fc32 100644 --- a/Core Data Editor/Core Data Editor/CDECSVImportWindow.xib +++ b/Core Data Editor/Core Data Editor/CDECSVImportWindow.xib @@ -1,1431 +1,271 @@ - - - 1080 - 12E55 - 3084 - 1187.39 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 3084 - - - NSArrayController - NSBox - NSButton - NSButtonCell - NSCustomObject - NSImageCell - NSImageView - NSMenu - NSMenuItem - NSObjectController - NSPopUpButton - NSPopUpButtonCell - NSScrollView - NSScroller - NSTableCellView - NSTableColumn - NSTableHeaderView - NSTableView - NSTextField - NSTextFieldCell - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - CDECSVImportWindowController - - - FirstResponder - - - NSApplication - - - NSEntityDescription - YES - - YES - YES - YES - YES - YES - - - YES - - YES - YES - YES - YES - YES - - - CDECSVImportWindowController - YES - - - - 15 - 2 - {{196, 240}, {564, 469}} - 1618477056 - CSV Import - NSWindow - - - {564, 469} - - - 256 - - - - 292 - {{20, 18}, {61, 25}} - - - - _NS:9 - YES - - 67108864 - 134217728 - Cancel - - LucidaGrande - 13 - 1044 - - _NS:9 - - -2038284288 - 163 - - - Gw - 200 - 25 - - NO - - - - 289 - {{475, 20}, {70, 25}} - - - - _NS:9 - YES - - 67108864 - 134217728 - Import… - - _NS:9 - - -2038284288 - 163 - - DQ - 200 - 25 - - NO - - - - 268 - {{139, 338}, {232, 25}} - - - - _NS:9 - YES - - -2080374720 - 2048 - - _NS:9 - - -2038284288 - 163 - - - 400 - 75 - - YES - - OtherViews - - - - -1 - 1 - YES - YES - 2 - - NO - - - - 274 - - - - 2304 - - - - 256 - - {522, 252} - - - - _NS:13 - YES - NO - YES - - - 256 - {522, 17} - - - - _NS:16 - - - - - -2147483392 - {{224, 0}, {16, 17}} - - _NS:19 - - - - AttributeName - 266.328125 - 40 - 1000 - - 75497536 - 2048 - Attribute Name - - LucidaGrande - 11 - 3100 - - - 3 - MC4zMzMzMzI5ODU2AA - - - 6 - System - headerTextColor - - 3 - MAA - - - - - 337641536 - 2048 - Text Cell - - - - 6 - System - controlBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - 3 - YES - YES - - - - 250 - 10 - 3.4028234663852886e+38 - - 75497536 - 2048 - CSV Column - - - 6 - System - headerColor - - 3 - MQA - - - - - - 337641536 - 2048 - Text Cell - - - - - - 3 - YES - YES - - - - 3 - 2 - - - 6 - System - gridColor - - 3 - MC41AA - - - 20 - -163577856 - - - 8 - 4 - 15 - 0 - YES - 0 - 1 - - - {{1, 17}, {522, 252}} - - - - _NS:11 - - - 4 - - - - -2147483392 - {{224, 17}, {15, 102}} - - - - _NS:58 - NO - - _doScroller: - 37 - 0.1947367936372757 - - - - -2147483392 - {{1, 154}, {510, 15}} - - - - _NS:60 - NO - 1 - - _doScroller: - 0.99804305283757333 - - - - 2304 - - - - {{1, 0}, {522, 17}} - - - - _NS:15 - - - 4 - - - {{20, 52}, {524, 270}} - - - - _NS:9 - 133682 - - - - - QSAAAEEgAABBsAAAQbAAAA - 0.25 - 4 - 1 - - - - 268 - {{17, 343}, {119, 17}} - - - - _NS:1505 - YES - - 68157504 - 71304192 - Import into entity: - - _NS:1505 - - - 6 - System - controlColor - - - - - NO - - - - 268 - {{17, 372}, {119, 17}} - - - - _NS:1505 - YES - - 68157504 - 71304192 - File: - - _NS:1505 - - - - - NO - - - - 10 - {{0, 399}, {564, 5}} - - - - _NS:9 - {0, 0} - - 67108864 - 0 - Box - - - 6 - System - textBackgroundColor - - - - 3 - MCAwLjgwMDAwMDAxMTkAA - - - 3 - 2 - 0 - NO - - - - 266 - {{138, 367}, {307, 22}} - - - - _NS:9 - YES - - -2080374720 - 272632320 - - - No File Selected - _NS:9 - - - - 6 - System - textColor - - - - NO - - - - 265 - {{450, 365}, {94, 25}} - - - - _NS:9 - YES - - 67108864 - 134217728 - Choose… - - _NS:9 - - -2038284288 - 163 - - - 200 - 25 - - NO - - - - 10 - - - - 274 - - - - 268 - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {{16, 19}, {32, 32}} - - - - _NS:9 - YES - - 134217728 - 33554432 - - NSImage - csv-icon - - _NS:9 - 0 - 2 - 0 - NO - - NO - YES - - - - 268 - {{53, 27}, {490, 17}} - - - - _NS:1505 - YES - - 68157504 - 272630784 - CSV Import - - LucidaGrande-Bold - 13 - 2072 - - _NS:1505 - - - - - NO - - - {564, 67} - - - - _NS:11 - - - {{0, 402}, {564, 67}} - - - - _NS:9 - {0, 0} - - 67108864 - 0 - Box - - - - 3 - MCAwLjgwMDAwMDAxMTkAA - - - - 0 - 4 - 0 - NO - - - - {564, 469} - - - - - {{0, 0}, {1920, 1058}} - {564, 491} - {10000000000000, 10000000000000} - YES - - - - - - - entityDescriptionsArrayController - - - - 159 - - - - mappingsArrayController - - - - 178 - - - - cancelImport: - - - - 222 - - - - pathToCSVFileTextField - - - - 248 - - - - confirmImport: - - - - 249 - - - - window - - - - 250 - - - - showOpenCSVFilePanel: - - - - 253 - - - - entitiesPopupButton - - - - 260 - - - - takeSelectedEntityFromSender: - - - - 261 - - - - enabled: selection.validCSVFileChosen - - - - - - enabled: selection.validCSVFileChosen - enabled - selection.validCSVFileChosen - 2 - - - 212 - - - - delegate - - - - 258 - - - - content: arrangedObjects - - - - - - content: arrangedObjects - content - arrangedObjects - 2 - - - 179 - - - - enabled: selection.validCSVFileChosen - - - - - - enabled: selection.validCSVFileChosen - enabled - selection.validCSVFileChosen - 2 - - - 213 - - - - textField - - - 274 - - - - 266 - {{0, 3}, {266, 17}} - - - {250, 750} - YES - - 67108928 - 272631808 - Table View Cell - - - - - - NO - - - {{1, 1}, {266, 20}} - - - - - 94 - - - - value: objectValue.attributeNameForDisplay - - - - - - value: objectValue.attributeNameForDisplay - value - objectValue.attributeNameForDisplay - 2 - - - 267 - - - - contentArray: entityDescriptions - - - - - - contentArray: entityDescriptions - contentArray - entityDescriptions - 2 - - - 107 - - - - contentValues: objectValue.columnNames - - - 266 - {{0, -1}, {250, 26}} - - - _NS:9 - YES - - -2080374720 - 2048 - - _NS:9 - - 100810752 - 129 - - - 400 - 75 - - - Item 2 - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - - YES - - OtherViews - - - - - - 1 - YES - YES - 2 - - NO - - - - 274 - - - - {{270, 1}, {250, 20}} - - - - - - contentValues: objectValue.columnNames - contentValues - objectValue.columnNames - 2 - - - 256 - - - - selectedIndex: objectValue.indexOfSelectedColumn - - - - - - selectedIndex: objectValue.indexOfSelectedColumn - selectedIndex - objectValue.indexOfSelectedColumn - - 2 - - - 257 - - - - content - - - - 188 - - - - enabled: selection.validCSVFileChosen - - - - - - enabled: selection.validCSVFileChosen - enabled - selection.validCSVFileChosen - 2 - - - 229 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - - - - - - - - - - - - - - - 106 - - - Entity Descriptions - - - 176 - - - Mappings - - - 186 - - - Importer Controller - - - 220 - - - - - - - - 221 - - - - - 226 - - - - - - - - 227 - - - - - 75 - - - - - - - - 76 - - - - - - - - 77 - - - - - - 82 - - - - - - - - - - - 83 - - - - - - - - - 84 - - - - - 85 - - - - - 86 - - - - - 87 - - - - - - - - - 142 - - - - - - - - - 143 - - - - - 144 - - - - - - - - 148 - - - - - - - - 149 - - - - - - - - 150 - - - - - - - - 152 - - - - - 90 - - - - - 91 - - - - - - - - 92 - - - - - - - - 93 - - - - - 74 - - - - - - - - 81 - - - - - 241 - - - - - 242 - - - - - - - - 243 - - - - - 246 - - - - - - - - 247 - - - - - 251 - - - - - - - - 252 - - - - - 262 - - - - - - - - - 263 - - - - - - - - 264 - - - - - - - - 265 - - - - - 266 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - {{357, 418}, {480, 270}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 267 - - - - - CDECSVImportWindowController - NSWindowController - - id - id - id - id - id - - - - cancelImport: - id - - - confirmImport: - id - - - selectedDestinationEntityChanged: - id - - - showOpenCSVFilePanel: - id - - - takeSelectedEntityFromSender: - id - - - - NSPopUpButton - NSArrayController - NSArrayController - NSTextField - - - - entitiesPopupButton - NSPopUpButton - - - entityDescriptionsArrayController - NSArrayController - - - mappingsArrayController - NSArrayController - - - pathToCSVFileTextField - NSTextField - - - - IBProjectSource - ./Classes/CDECSVImportWindowController.h - - - - - 0 - IBCocoaFramework - YES - 3 - - {11, 11} - {10, 3} - {32, 32} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core Data Editor/Core Data Editor/CDECSVImportWindowController.h b/Core Data Editor/Core Data Editor/CDECSVImportWindowController.h index 2daf0d9..63174b0 100644 --- a/Core Data Editor/Core Data Editor/CDECSVImportWindowController.h +++ b/Core Data Editor/Core Data Editor/CDECSVImportWindowController.h @@ -10,6 +10,6 @@ typedef void(^CDECSVImportWindowControllerCompletionHandler)(CDECSVImportWindowC @property (nonatomic, copy, readonly) NSArray *entityDescriptions; #pragma mark Presenting the Window Controller -- (void)beginSheetModalForWindow:(NSWindow *)window entityDescriptions:(NSArray *)entityDescriptions selectedEntityDescription:(NSEntityDescription *)selectedEntityDescription completionHandler:(CDECSVImportWindowControllerCompletionHandler)completionHandler; +- (void)beginSheetModalForWindow:(NSWindow *)window entityDescriptions:(NSArray *)entityDescriptions selectedEntityDescription:(NSEntityDescription *)selectedEntityDescription completionHandler:(CDECSVImportWindowControllerCompletionHandler)completionHandler; @end diff --git a/Core Data Editor/Core Data Editor/CDECSVImportWindowController.m b/Core Data Editor/Core Data Editor/CDECSVImportWindowController.m index 546ffa9..0c0187f 100644 --- a/Core Data Editor/Core Data Editor/CDECSVImportWindowController.m +++ b/Core Data Editor/Core Data Editor/CDECSVImportWindowController.m @@ -217,7 +217,7 @@ - (IBAction)selectedDestinationEntityChanged:(id)sender { } #pragma mark Presenting the Window Controller -- (void)beginSheetModalForWindow:(NSWindow *)parentWindow entityDescriptions:(NSArray *)entityDescriptions selectedEntityDescription:(NSEntityDescription *)selectedEntityDescription completionHandler:(CDECSVImportWindowControllerCompletionHandler)completionHandler { +- (void)beginSheetModalForWindow:(NSWindow *)parentWindow entityDescriptions:(NSArray *)entityDescriptions selectedEntityDescription:(NSEntityDescription *)selectedEntityDescription completionHandler:(CDECSVImportWindowControllerCompletionHandler)completionHandler { NSParameterAssert(entityDescriptions); NSParameterAssert(parentWindow); self.entityDescriptions = entityDescriptions; @@ -229,7 +229,6 @@ - (void)beginSheetModalForWindow:(NSWindow *)parentWindow entityDescriptions:(NS self.completionHandler = completionHandler; [self window]; // Entities Popup Button: Begin - [self.entitiesPopupButton removeAllItems]; NSMenuItem *selectedItem = nil; @@ -251,21 +250,27 @@ - (void)beginSheetModalForWindow:(NSWindow *)parentWindow entityDescriptions:(NS // Entities Popup Button: End [self updateMappingsArrayController]; - - [parentWindow beginSheet:self.window completionHandler:^(NSModalResponse returnCode) { + [parentWindow beginSheet:self.window completionHandler:^(NSModalResponse returnCode) { + self.completionHandler ? self.completionHandler([self resultForCurrentConfiguration]) : nil; + self.completionHandler = nil; + + }]; + [self showOpenCSVFilePanel:self]; +} + +- (void)importWindowDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { + [sheet orderOut:self]; self.completionHandler ? self.completionHandler([self resultForCurrentConfiguration]) : nil; self.completionHandler = nil; - }]; - [self showOpenCSVFilePanel:self]; } - (IBAction)cancelImport:(id)sender { self.completionHandler = nil; - [NSApp endSheet:self.window]; + [self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK]; } - (IBAction)confirmImport:(id)sender { - [NSApp endSheet:self.window]; + [self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK]; } - (IBAction)takeSelectedEntityFromSender:(id)sender { diff --git a/Core Data Editor/Core Data Editor/CDECSVImportWindowControllerResult.h b/Core Data Editor/Core Data Editor/CDECSVImportWindowControllerResult.h index cff0b62..457dcd0 100644 --- a/Core Data Editor/Core Data Editor/CDECSVImportWindowControllerResult.h +++ b/Core Data Editor/Core Data Editor/CDECSVImportWindowControllerResult.h @@ -1,12 +1,13 @@ #import +@class CDECSVImportWindowControllerResultItem; @interface CDECSVImportWindowControllerResult : NSObject #pragma mark Creating -- (instancetype)initWithItems:(NSArray *)items destinationEntityDescription:(NSEntityDescription *)destinationEntityDescription; +- (instancetype)initWithItems:(NSArray *)items destinationEntityDescription:(NSEntityDescription *)destinationEntityDescription; #pragma mark Properties -@property (nonatomic, copy, readonly) NSArray *items; +@property (nonatomic, copy, readonly) NSArray *items; @property (nonatomic, strong, readonly) NSEntityDescription *destinationEntityDescription; @end diff --git a/Core Data Editor/Core Data Editor/CDECSVImportWindowControllerResult.m b/Core Data Editor/Core Data Editor/CDECSVImportWindowControllerResult.m index 590162a..31d28ad 100644 --- a/Core Data Editor/Core Data Editor/CDECSVImportWindowControllerResult.m +++ b/Core Data Editor/Core Data Editor/CDECSVImportWindowControllerResult.m @@ -3,7 +3,7 @@ @interface CDECSVImportWindowControllerResult () #pragma mark Properties -@property (nonatomic, copy, readwrite) NSArray *items; +@property (nonatomic, copy, readwrite) NSArray *items; @property (nonatomic, strong, readwrite) NSEntityDescription *destinationEntityDescription; @end @@ -11,7 +11,7 @@ @interface CDECSVImportWindowControllerResult () @implementation CDECSVImportWindowControllerResult #pragma mark Creating -- (id)initWithItems:(NSArray *)items destinationEntityDescription:(NSEntityDescription *)destinationEntityDescription { +- (id)initWithItems:(NSArray *)items destinationEntityDescription:(NSEntityDescription *)destinationEntityDescription { self = [super init]; if(self) { self.items = items; diff --git a/Core Data Editor/Core Data Editor/CDECodeGenerator.h b/Core Data Editor/Core Data Editor/CDECodeGenerator.h deleted file mode 100644 index daa8195..0000000 --- a/Core Data Editor/Core Data Editor/CDECodeGenerator.h +++ /dev/null @@ -1,16 +0,0 @@ -#import - -typedef void(^CDECodeGeneratorCompletionHandler)(void); - -@interface CDECodeGenerator : NSObject - -#pragma mark Creating -- (instancetype)initWithManagedObjectModelURL:(NSURL *)managedObjectModelURL_; - -#pragma mark Properties -@property (nonatomic, strong, readonly) NSURL *managedObjectModelURL; - -#pragma mark Presenting the Code Generator UI -- (void)presentCodeGeneratorUIModalForWindow:(NSWindow *)parentWindow_ completionHandler:(CDECodeGeneratorCompletionHandler)completionHandler_; - -@end diff --git a/Core Data Editor/Core Data Editor/CDECodeGenerator.m b/Core Data Editor/Core Data Editor/CDECodeGenerator.m deleted file mode 100644 index 68733ec..0000000 --- a/Core Data Editor/Core Data Editor/CDECodeGenerator.m +++ /dev/null @@ -1,65 +0,0 @@ -#import "CDECodeGenerator.h" -#import "CDEManagedObjectSubclassesGenerator.h" -#import "CDECodeGeneratorAccessoryViewController.h" - -@interface CDECodeGenerator () - -#pragma mark Properties -@property (nonatomic, strong, readwrite) NSURL *managedObjectModelURL; -@property (nonatomic, copy) CDECodeGeneratorCompletionHandler completionHandler; -@property (nonatomic, strong) CDECodeGeneratorAccessoryViewController *accessoryViewController; - -@end - -@implementation CDECodeGenerator - -#pragma mark Creating -- (instancetype)initWithManagedObjectModelURL:(NSURL *)managedObjectModelURL { - self = [super init]; - if(self) { - self.completionHandler = nil; - self.managedObjectModelURL = managedObjectModelURL; - self.accessoryViewController = [CDECodeGeneratorAccessoryViewController new]; - } - return self; -} - -- (instancetype)init { - return [self initWithManagedObjectModelURL:nil]; -} - -#pragma mark Presenting the Code Generator UI -- (void)presentCodeGeneratorUIModalForWindow:(NSWindow *)parentWindow completionHandler:(CDECodeGeneratorCompletionHandler)completionHandler { - if(parentWindow == nil) { - self.completionHandler = nil; - return; - } - self.completionHandler = completionHandler; - NSOpenPanel *savePanel = [NSOpenPanel openPanel]; - [savePanel setCanChooseDirectories:YES]; - [savePanel setCanCreateDirectories:YES]; - [savePanel setCanChooseFiles:NO]; - [savePanel setPrompt:@"Generate"]; - savePanel.accessoryView = self.accessoryViewController.view; - [savePanel beginSheetModalForWindow:parentWindow completionHandler:^(NSInteger result) { - if(result != NSFileHandlingPanelOKButton) { - return; - } - NSFileManager *fileManager = [NSFileManager new]; - NSURL *libraryURL = [[fileManager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject]; - NSURL *applicationFilesDirectory = [libraryURL URLByAppendingPathComponent:@"Core Data Editor"]; - if([fileManager fileExistsAtPath:applicationFilesDirectory.path] == NO) { - [fileManager createDirectoryAtPath:applicationFilesDirectory.path withIntermediateDirectories:YES attributes:nil error:nil]; - } - NSURL *modelURL = self.managedObjectModelURL; - CDEManagedObjectSubclassesGenerator *generator = [[CDEManagedObjectSubclassesGenerator alloc] initWithOutputDirectory:[savePanel directoryURL] modelPath:modelURL applicationFilesDirectory:applicationFilesDirectory]; - generator.generateARCCompatibleCode = self.accessoryViewController.generateARCCompatibleCode.boolValue; - generator.generateFetchResultsControllerCode = self.accessoryViewController.generateFetchResultsControllerCode.boolValue; - [generator generate]; - [[NSWorkspace sharedWorkspace] selectFile:[generator.readmeURL path] inFileViewerRootedAtPath:@""]; - self.completionHandler ? self.completionHandler() : nil; - }]; - -} - -@end diff --git a/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.h b/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.h deleted file mode 100644 index 8c7c584..0000000 --- a/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.h +++ /dev/null @@ -1,12 +0,0 @@ -#import - -@interface CDECodeGeneratorAccessoryViewController : NSViewController - -#pragma mark Creating an Instance -- (instancetype)init; - -#pragma mark Properties -@property (nonatomic, copy) NSNumber *generateARCCompatibleCode; -@property (nonatomic, copy) NSNumber *generateFetchResultsControllerCode; - -@end diff --git a/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.m b/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.m deleted file mode 100644 index fa93911..0000000 --- a/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.m +++ /dev/null @@ -1,24 +0,0 @@ -#import "CDECodeGeneratorAccessoryViewController.h" - -@interface CDECodeGeneratorAccessoryViewController () - -@end - -@implementation CDECodeGeneratorAccessoryViewController - - -#pragma mark Creating an Instance -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:@"CDECodeGeneratorAccessoryViewController" bundle:nil]; - if(self) { - self.generateARCCompatibleCode = @YES; - self.generateFetchResultsControllerCode = @YES; - } - return self; -} - -- (instancetype)init { - return [self initWithNibName:nil bundle:nil]; -} - -@end diff --git a/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.xib b/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.xib deleted file mode 100644 index dc749bf..0000000 --- a/Core Data Editor/Core Data Editor/CDECodeGeneratorAccessoryViewController.xib +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - You have to set the class name of your entities to something other than NSManagedObject. Otherwise no code will be generated for these entities. - - - - - - - - - - - - - - - - - - diff --git a/Core Data Editor/Core Data Editor/CDEConfigurationWizzard.m b/Core Data Editor/Core Data Editor/CDEConfigurationWizzard.m index 7020aee..cc911be 100644 --- a/Core Data Editor/Core Data Editor/CDEConfigurationWizzard.m +++ b/Core Data Editor/Core Data Editor/CDEConfigurationWizzard.m @@ -187,7 +187,6 @@ - (void)beginSheetModalForWindow:(NSWindow *)parentWindow completionHandler:(CDE [self.summaryViewController view]; [self showDropApplicationView]; self.editing = NO; - [parentWindow beginSheet:self.window completionHandler:^(NSModalResponse returnCode) { }]; @@ -211,8 +210,7 @@ - (void)beginSheetModalForWindow:(NSWindow *)parentWindow applicationBundleURL:( #pragma mark Actions - (IBAction)dismiss:(id)sender { - [NSApp endSheet:self.window]; - [self.window orderOut:sender]; + [self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK]; (self.beginSheetCompletionHandler)(NO, nil, nil, nil); self.beginSheetCompletionHandler = nil; } @@ -245,8 +243,7 @@ - (IBAction)nextShowSummaryCreate:(id)sender { if([self displaysSummaryView]) { // Create - [NSApp endSheet:self.window]; - [self.window orderOut:sender]; + [self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK]; NSURL *modelURL = self.dropApplicationViewController.modelURL; NSURL *applicationBundleURL = self.dropApplicationViewController.bundleURL; if(modelURL == nil && applicationBundleURL != nil) { diff --git a/Core Data Editor/Core Data Editor/CDEDateAttributeView.xib b/Core Data Editor/Core Data Editor/CDEDateAttributeView.xib index f101403..aae75a4 100644 --- a/Core Data Editor/Core Data Editor/CDEDateAttributeView.xib +++ b/Core Data Editor/Core Data Editor/CDEDateAttributeView.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDEDatePickerViewController.xib b/Core Data Editor/Core Data Editor/CDEDatePickerViewController.xib index cfbf883..c94ca66 100644 --- a/Core Data Editor/Core Data Editor/CDEDatePickerViewController.xib +++ b/Core Data Editor/Core Data Editor/CDEDatePickerViewController.xib @@ -1,80 +1,435 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + 1080 + 12E55 + 3084 + 1187.39 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSDatePicker + NSDatePickerCell + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + CDEDatePickerViewController + + + FirstResponder + + + NSApplication + + + + 274 + + + + 290 + {{3, 31}, {133, 46}} + + + + _NS:9 + YES + + 71303168 + 0 + + -595929600 + + US/Pacific + + VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAC5AAAABAAAABCepkign7sVkKCGKqChmveQ +y4kaoNIj9HDSYSYQ1v50INiArZDa/tGg28CQENzes6DdqayQ3r6VoN+JjpDgnneg4WlwkOJ+WaDjSVKQ +5F47oOUpNJDmR1gg5xJREOgnOiDo8jMQ6gccIOrSFRDr5v4g7LH3EO3G4CDukdkQ76/8oPBxuxDxj96g +8n/BkPNvwKD0X6OQ9U+ioPY/hZD3L4Sg+CiiEPkPZqD6CIQQ+viDIPvoZhD82GUg/chIEP64RyD/qCoQ +AJgpIAGIDBACeAsgA3EokARhJ6AFUQqQBkEJoAcw7JAHjUOgCRDOkAmtvyAK8LCQC+CvoAzZzRANwJGg +DrmvEA+priAQmZEQEYmQIBJ5cxATaXIgFFlVEBVJVCAWOTcQFyk2IBgiU5AZCRggGgI1kBryNKAb4heQ +HNIWoB3B+ZAesfigH6HbkCB2KyAhgb2QIlYNICNq2hAkNe8gJUq8ECYV0SAnKp4QJ/7toCkKgBAp3s+g +KupiECu+saAs036QLZ6ToC6zYJAvfnWgMJNCkDFnkiAycySQM0d0IDRTBpA1J1YgNjLokDcHOCA4HAUQ +OOcaIDn75xA6xvwgO9vJEDywGKA9u6sQPo/6oD+bjRBAb9ygQYSpkEJPvqBDZIuQRC+goEVEbZBF89Mg +Ry2KEEfTtSBJDWwQSbOXIErtThBLnLOgTNZqkE18laBOtkyQT1x3oFCWLpBRPFmgUnYQkFMcO6BUVfKQ +VPwdoFY11JBW5TogWB7xEFjFHCBZ/tMQWqT+IFvetRBchOAgXb6XEF5kwiBfnnkQYE3eoGGHlZBiLcCg +Y2d3kGQNoqBlR1mQZe2EoGcnO5BnzWagaQcdkGmtSKBq5v+Qa5ZlIGzQHBBtdkcgbq/+EG9WKSBwj+AQ +cTYLIHJvwhBzFe0gdE+kEHT/CaB2OMCQdt7roHgYopB4vs2gefiEkHqer6B72GaQfH6RoH24SJB+XnOg +f5gqkAABAAECAwEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA + + + %Y-%m-%d %H:%M:%S %z + + + LucidaGrande + 13 + 1044 + + _NS:9 + + 0.0 + 14 + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 289 + {{28, 4}, {58, 19}} + + + + YES + + -2080374784 + 134217728 + Cancel + + LucidaGrande + 12 + 16 + + + -2038153216 + 164 + + + 400 + 75 + + NO + + + + 289 + {{94, 4}, {39, 19}} + + + + YES + + -2080374784 + 134217728 + OK + + + -2038153216 + 164 + + + 400 + 75 + + NO + + + + 264 + {{0, 57}, {139, 148}} + + + + YES + + 67108864 + 0 + + -595929600 + + US/Pacific + + VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAC5AAAABAAAABCepkign7sVkKCGKqChmveQ +y4kaoNIj9HDSYSYQ1v50INiArZDa/tGg28CQENzes6DdqayQ3r6VoN+JjpDgnneg4WlwkOJ+WaDjSVKQ +5F47oOUpNJDmR1gg5xJREOgnOiDo8jMQ6gccIOrSFRDr5v4g7LH3EO3G4CDukdkQ76/8oPBxuxDxj96g +8n/BkPNvwKD0X6OQ9U+ioPY/hZD3L4Sg+CiiEPkPZqD6CIQQ+viDIPvoZhD82GUg/chIEP64RyD/qCoQ +AJgpIAGIDBACeAsgA3EokARhJ6AFUQqQBkEJoAcw7JAHjUOgCRDOkAmtvyAK8LCQC+CvoAzZzRANwJGg +DrmvEA+priAQmZEQEYmQIBJ5cxATaXIgFFlVEBVJVCAWOTcQFyk2IBgiU5AZCRggGgI1kBryNKAb4heQ +HNIWoB3B+ZAesfigH6HbkCB2KyAhgb2QIlYNICNq2hAkNe8gJUq8ECYV0SAnKp4QJ/7toCkKgBAp3s+g +KupiECu+saAs036QLZ6ToC6zYJAvfnWgMJNCkDFnkiAycySQM0d0IDRTBpA1J1YgNjLokDcHOCA4HAUQ +OOcaIDn75xA6xvwgO9vJEDywGKA9u6sQPo/6oD+bjRBAb9ygQYSpkEJPvqBDZIuQRC+goEVEbZBF89Mg +Ry2KEEfTtSBJDWwQSbOXIErtThBLnLOgTNZqkE18laBOtkyQT1x3oFCWLpBRPFmgUnYQkFMcO6BUVfKQ +VPwdoFY11JBW5TogWB7xEFjFHCBZ/tMQWqT+IFvetRBchOAgXb6XEF5kwiBfnnkQYE3eoGGHlZBiLcCg +Y2d3kGQNoqBlR1mQZe2EoGcnO5BnzWagaQcdkGmtSKBq5v+Qa5ZlIGzQHBBtdkcgbq/+EG9WKSBwj+AQ +cTYLIHJvwhBzFe0gdE+kEHT/CaB2OMCQdt7roHgYopB4vs2gefiEkHqer6B72GaQfH6RoH24SJB+XnOg +f5gqkAABAAECAwEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA + + + %Y-%m-%d %H:%M:%S %z + + + + 0.0 + 224 + 1 + + + + NO + + + {139, 205} + + + + NSView + + + + + + + view + + + + 3 + + + + datePicker + + + + 8 + + + + ok: + + + + 14 + + + + cancel: + + + + 15 + + + + changeDateTime: + + + + 18 + + + + changeDate: + + + + 19 + + + + dateTimePicker + + + + 20 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + + + + 4 + + + + + + + + 5 + + + + + 6 + + + + + + + + 7 + + + + + 9 + + + + + + + + 10 + + + + + 16 + + + + + + + + 17 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 20 + + + + + CDEDatePickerViewController + NSViewController + + id + id + id + + + + cancel: + id + + + changeDate: + id + + + ok: + id + + + + NSDatePicker + NSDatePicker + + + + datePicker + NSDatePicker + + + dateTimePicker + NSDatePicker + + + + IBProjectSource + ./Classes/CDEDatePickerViewController.h + + + + + 0 + IBCocoaFramework + YES + 3 + + diff --git a/Core Data Editor/Core Data Editor/CDEDocument.m b/Core Data Editor/Core Data Editor/CDEDocument.m index 658f1a2..ede890e 100644 --- a/Core Data Editor/Core Data Editor/CDEDocument.m +++ b/Core Data Editor/Core Data Editor/CDEDocument.m @@ -10,7 +10,6 @@ #import "CDEManagedObjectIDToStringValueTransformer.h" #import "CDEAutosaveInformation.h" -#import "CDECodeGenerator.h" @interface CDEDocument () @@ -27,9 +26,6 @@ @interface CDEDocument () #pragma mark - Actions - (IBAction)showConfiguration:(id)sender; -#pragma mark - Code Generation -@property (nonatomic, strong) CDECodeGenerator *codeGenerator; - @end @implementation CDEDocument @@ -234,6 +230,7 @@ - (BOOL)setupAndStartAccessingConfigurationRelatedURLsAndGetError:(NSError **)er - (void)windowControllerDidLoadNib:(NSWindowController *)windowController { [super windowControllerDidLoadNib:windowController]; + [self _documentWindow].titleVisibility = NSWindowTitleHidden; self.editorViewController.view.frame = self.containerView.bounds; [self.containerView addSubview:self.editorViewController.view]; @@ -287,9 +284,6 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)windowController { [errorMessages addObject:@"• Store could not be accessed."]; NSLog(@"failed to access store"); } - else { - self.fileURL = self.storeURL; - } } // If there aren't any error messages we can check for compatibility NSManagedObjectModel *model = nil; @@ -379,17 +373,4 @@ - (IBAction)showImportCSVFileWindow:(id)sender { [self.editorViewController showImportCSVFileWindow:sender]; } -- (IBAction)generateCode:(id)sender { - if(self.codeGenerator != nil) { - self.codeGenerator = nil; - } - - self.codeGenerator = [[CDECodeGenerator alloc] initWithManagedObjectModelURL:self.modelURL]; - __typeof__(self) __weak weakSelf = self; - [self.codeGenerator presentCodeGeneratorUIModalForWindow:[self _documentWindow] completionHandler:^{ - [weakSelf setCodeGenerator:nil]; - }]; -} - - @end diff --git a/Core Data Editor/Core Data Editor/CDEDropStoreViewController.m b/Core Data Editor/Core Data Editor/CDEDropStoreViewController.m index fe4e9e3..610ee39 100644 --- a/Core Data Editor/Core Data Editor/CDEDropStoreViewController.m +++ b/Core Data Editor/Core Data Editor/CDEDropStoreViewController.m @@ -11,23 +11,23 @@ @implementation CDEDropStoreViewController (Private) - (BOOL)isValidStoreAtURL:(NSURL *)URL error:(NSError **)error { - NSAssert(self.managedObjectModel != nil, @"We need a managed object model."); - - if(URL == nil) { - NSLog(@"Drop has no URL."); - return NO; - } - BOOL result = [self.managedObjectModel isCompatibleWithStoreAtURL:URL error_cde:error]; - - return result; + NSAssert(self.managedObjectModel != nil, @"We need a managed object model."); + + if(URL == nil) { + NSLog(@"Drop has no URL."); + return NO; + } + BOOL result = [self.managedObjectModel isCompatibleWithStoreAtURL:URL error_cde:error]; + + return result; } - (BOOL)dropIsValidStore:(id)drop error:(NSError **)error { - NSAssert(self.managedObjectModel != nil, @"We need a managed object model."); - - NSPasteboard *pasteboard = [drop draggingPasteboard]; - NSURL *URL = [NSURL URLFromPasteboard:pasteboard]; - return [self isValidStoreAtURL:URL error:error]; + NSAssert(self.managedObjectModel != nil, @"We need a managed object model."); + + NSPasteboard *pasteboard = [drop draggingPasteboard]; + NSURL *URL = [NSURL URLFromPasteboard:pasteboard]; + return [self isValidStoreAtURL:URL error:error]; } @end @@ -35,115 +35,116 @@ - (BOOL)dropIsValidStore:(id)drop error:(NSError **)error { @implementation CDEDropStoreViewController - (void)setValidStoreURL:(NSURL *)newValue { - if(newValue != _validStoreURL) { - _validStoreURL = [newValue copy]; - [self view]; - [self.pathActionLabelController setPath:self.validStoreURL.path]; - [self.dropZoneView setURL:self.validStoreURL]; - } + if(newValue != _validStoreURL) { + _validStoreURL = [newValue copy]; + [self view]; + [self.pathActionLabelController setPath:self.validStoreURL.path]; + [self.dropZoneView setURL:self.validStoreURL]; + } } - (void)setEditing:(BOOL)newValue { - _editing = newValue; - [self view]; - NSString *localizedInfoKey = @"DropStoreInfoTextWhenCreatingNewProject"; - if(self.isEditing) { - localizedInfoKey = @"DropStoreInfoTextWhenEditingProject"; - } - self.infoTextField.stringValue = NSLocalizedString(localizedInfoKey, nil); + _editing = newValue; + [self view]; + NSString *localizedInfoKey = @"DropStoreInfoTextWhenCreatingNewProject"; + if(self.isEditing) { + localizedInfoKey = @"DropStoreInfoTextWhenEditingProject"; + } + self.infoTextField.stringValue = NSLocalizedString(localizedInfoKey, nil); } #pragma mark Creating - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - - if(self) { - self.validStoreURL = nil; - self.delegate = nil; - self.managedObjectModel = nil; - self.editing = NO; - } - return self; + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + + if(self) { + self.validStoreURL = nil; + self.delegate = nil; + self.managedObjectModel = nil; + self.editing = NO; + } + return self; } - (id)init { - return [self initWithNibName:NSStringFromClass([self class]) bundle:nil]; + return [self initWithNibName:NSStringFromClass([self class]) bundle:nil]; } #pragma mark Actions - (IBAction)createNewStore:(id)sender { - NSSavePanel *panel = [NSSavePanel savePanel]; - NSInteger result = [panel runModal]; - if(result != NSFileHandlingPanelOKButton) { - return; - } - NSURL *URL = [panel URL]; - - NSURL *temp = [[NSURL fileURLWithPath:NSTemporaryDirectory()] URLByAppendingPathComponent:[[NSUUID UUID] UUIDString] isDirectory:YES]; - NSFileManager *fileManager = [NSFileManager new]; - NSError *error = nil; - if([fileManager createDirectoryAtURL:temp withIntermediateDirectories:YES attributes:nil error:&error] == NO) { - NSLog(@"Failed to create new store: %@", error); - [[NSDocumentController sharedDocumentController] presentError:error]; - return; - } - temp = [temp URLByAppendingPathComponent:[URL lastPathComponent] isDirectory:NO]; - - NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel]; - error = nil; - NSPersistentStore *store = [coordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:temp options:nil error:&error]; - if(store == nil) { - [[NSDocumentController sharedDocumentController] presentError:error]; - return; - } - error = nil; - NSData *storeData = [NSData dataWithContentsOfURL:temp options:0 error:&error]; - if(storeData == nil) { - NSLog(@"Failed to create new store (read failed): %@", error); - [[NSDocumentController sharedDocumentController] presentError:error]; - return; - } - [storeData writeToURL:URL atomically:YES]; - [self setValidStoreURL:URL]; - [self.delegate dropStoreViewController:self didChangeStoreURL:self.validStoreURL]; + NSSavePanel *panel = [NSSavePanel savePanel]; + [panel beginSheetModalForWindow:self.view.window completionHandler:^(NSInteger result) { + if(result != NSFileHandlingPanelOKButton) { + return; + } + NSURL *URL = [panel URL]; + + NSURL *temp = [[NSURL fileURLWithPath:NSTemporaryDirectory()] URLByAppendingPathComponent:[[NSUUID UUID] UUIDString] isDirectory:YES]; + NSFileManager *fileManager = [NSFileManager new]; + NSError *error = nil; + if([fileManager createDirectoryAtURL:temp withIntermediateDirectories:YES attributes:nil error:&error] == NO) { + NSLog(@"Failed to create new store: %@", error); + [[NSDocumentController sharedDocumentController] presentError:error]; + return; + } + temp = [temp URLByAppendingPathComponent:[URL lastPathComponent] isDirectory:NO]; + + NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel]; + error = nil; + NSPersistentStore *store = [coordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:temp options:nil error:&error]; + if(store == nil) { + [[NSDocumentController sharedDocumentController] presentError:error]; + return; + } + error = nil; + NSData *storeData = [NSData dataWithContentsOfURL:temp options:0 error:&error]; + if(storeData == nil) { + NSLog(@"Failed to create new store (read failed): %@", error); + [[NSDocumentController sharedDocumentController] presentError:error]; + return; + } + [storeData writeToURL:URL atomically:YES]; + [self setValidStoreURL:URL]; + [self.delegate dropStoreViewController:self didChangeStoreURL:self.validStoreURL]; + }]; } #pragma mark CDEDropZoneViewDelegate - (NSString *)titleForDropZoneView:(CDEDropZoneView *)view { - return @"Drop your Persistent Store here.\n\nIf you don't have one click on \"Create Store File\"."; + return @"Drop your Persistent Store here.\n\nIf you don't have one click on \"Create Store File\"."; } - (NSDragOperation)dropZoneView:(CDEDropZoneView *)view validateDrop:(id)info { - NSError *error = nil; - BOOL isValid = [self dropIsValidStore:info error:&error]; - if(isValid == NO) { - self.dropZoneView.displayedError = error; - return NSDragOperationNone; - } - return NSDragOperationEvery; + NSError *error = nil; + BOOL isValid = [self dropIsValidStore:info error:&error]; + if(isValid == NO) { + self.dropZoneView.displayedError = error; + return NSDragOperationNone; + } + return NSDragOperationEvery; } - (BOOL)dropZoneView:(CDEDropZoneView *)view acceptDrop:(id)info { - NSError *error = nil; - BOOL isValid = [self dropIsValidStore:info error:&error]; - if(isValid == NO) { - self.dropZoneView.displayedError = error; - return NO; - } - return YES; + NSError *error = nil; + BOOL isValid = [self dropIsValidStore:info error:&error]; + if(isValid == NO) { + self.dropZoneView.displayedError = error; + return NO; + } + return YES; } - (void)dropZoneView:(CDEDropZoneView *)view didChangeURL:(NSURL *)newURL { - NSError *error = nil; - BOOL validStore = [self isValidStoreAtURL:newURL error:&error]; - if(validStore) { - self.validStoreURL = newURL; - self.dropZoneView.displayedError = nil; - [self.delegate dropStoreViewController:self didChangeStoreURL:newURL]; - } else { - self.dropZoneView.displayedError = error; - self.validStoreURL = nil; - } + NSError *error = nil; + BOOL validStore = [self isValidStoreAtURL:newURL error:&error]; + if(validStore) { + self.validStoreURL = newURL; + self.dropZoneView.displayedError = nil; + [self.delegate dropStoreViewController:self didChangeStoreURL:newURL]; + } else { + self.dropZoneView.displayedError = error; + self.validStoreURL = nil; + } } @end diff --git a/Core Data Editor/Core Data Editor/CDEDropZoneView.m b/Core Data Editor/Core Data Editor/CDEDropZoneView.m index fbcc6e3..cc5c5c3 100644 --- a/Core Data Editor/Core Data Editor/CDEDropZoneView.m +++ b/Core Data Editor/Core Data Editor/CDEDropZoneView.m @@ -112,9 +112,6 @@ - (NSRect)errorMessageIconRect { - (void)drawBackground { NSColor *topColor = [NSColor colorWithCalibratedWhite:1 alpha:0.7]; NSColor *bottomColor = [NSColor colorWithCalibratedWhite:0.923 alpha:0.7]; -// NSColor *topColor = [NSColor colorWithCalibratedWhite:0.923 alpha:1.000]; -// NSColor *bottomColor = [NSColor colorWithCalibratedWhite:0.8 alpha:1.000]; - NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:topColor endingColor:bottomColor]; [gradient drawInRect:self.bounds angle:-90.0]; } @@ -146,9 +143,7 @@ - (void)drawDropZone { NSAttributedString *titleAttributedString = [self attributedStringToDisplayFrom:title]; NSRect titleRect = dashedBorderRect; -// titleRect.origin.x += borderSpacing; -// titleRect.size.width -= 2.0 * borderSpacing; - + CGFloat titleHeight = NSHeight([titleAttributedString boundingRectWithSize:NSMakeSize(NSWidth(titleRect), CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin]); titleRect.origin.y = NSMidY(titleRect) - (0.5 * titleHeight); @@ -244,15 +239,8 @@ - (void)drawRect:(NSRect)dirtyRect { [self drawErrorMessage]; } -// [NSGraphicsContext saveGraphicsState]; [[NSColor grayColor] set]; [[NSBezierPath bezierPathWithRect:NSInsetRect(self.bounds, 0.0, 0.0)] stroke]; - -// NSRect focusRingFrame = self.bounds; -// focusRingFrame.size.height -= 2.0; -// NSSetFocusRingStyle(NSFocusRingOnly); -// [[NSBezierPath bezierPathWithRect: NSInsetRect(focusRingFrame,0,0)] fill]; -// [NSGraphicsContext restoreGraphicsState]; } @@ -315,8 +303,7 @@ - (BOOL)performDragOperation:(id)sender { return YES; } -- (void)concludeDragOperation:(id )sender { -} +- (void)concludeDragOperation:(id )sender {} #pragma mark NSAnimationDelegate - (void)animation:(NSAnimation *)animation didReachProgressMark:(NSAnimationProgress)progress { diff --git a/Core Data Editor/Core Data Editor/CDEEditorViewController.xib b/Core Data Editor/Core Data Editor/CDEEditorViewController.xib index 0dddaba..cbf8511 100644 --- a/Core Data Editor/Core Data Editor/CDEEditorViewController.xib +++ b/Core Data Editor/Core Data Editor/CDEEditorViewController.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDEEntitiesViewController.xib b/Core Data Editor/Core Data Editor/CDEEntitiesViewController.xib index 8f36206..f35a662 100644 --- a/Core Data Editor/Core Data Editor/CDEEntitiesViewController.xib +++ b/Core Data Editor/Core Data Editor/CDEEntitiesViewController.xib @@ -1,7 +1,6 @@ - @@ -21,7 +20,7 @@ - + diff --git a/Core Data Editor/Core Data Editor/CDEManagedObjectSubclassesGenerator.h b/Core Data Editor/Core Data Editor/CDEManagedObjectSubclassesGenerator.h deleted file mode 100644 index 0fa731f..0000000 --- a/Core Data Editor/Core Data Editor/CDEManagedObjectSubclassesGenerator.h +++ /dev/null @@ -1,19 +0,0 @@ -#import - -@interface CDEManagedObjectSubclassesGenerator : NSObject - -#pragma mark Creating -- (instancetype)initWithOutputDirectory:(NSURL *)initOutputDirectory modelPath:(NSURL *)initModelPath applicationFilesDirectory:(NSURL *)initApplicationFilesDirectory; - -#pragma mark Properties -@property (nonatomic, copy, readonly) NSURL *outputDirectory; -@property (nonatomic, copy, readonly) NSURL *modelPath; -@property (nonatomic, copy, readonly) NSURL *applicationFilesDirectory; -@property (nonatomic, readonly) NSURL *readmeURL; -@property (nonatomic, assign) BOOL generateARCCompatibleCode; -@property (assign) BOOL generateFetchResultsControllerCode; - -#pragma mark Generate the Subclasses -- (void)generate; - -@end diff --git a/Core Data Editor/Core Data Editor/CDEManagedObjectSubclassesGenerator.m b/Core Data Editor/Core Data Editor/CDEManagedObjectSubclassesGenerator.m deleted file mode 100644 index 32d81fc..0000000 --- a/Core Data Editor/Core Data Editor/CDEManagedObjectSubclassesGenerator.m +++ /dev/null @@ -1,123 +0,0 @@ -#import "CDEManagedObjectSubclassesGenerator.h" - -@interface CDEManagedObjectSubclassesGenerator () - -#pragma mark Properties -@property (nonatomic, copy, readwrite) NSURL *outputDirectory; -@property (nonatomic, copy, readwrite) NSURL *modelPath; -@property (nonatomic, copy, readwrite) NSURL *applicationFilesDirectory; - -#pragma mark Private Methods -- (NSString *)mogeneratorTemplatesDirectory; -- (void)createTemplateFolderAndCopyTemplatesIfNeeded; -- (void)checkIfBundleResource:(NSString *)resource ofType:(NSString *)type existsInDirectoryAndCopyIfNeeded:(NSString *)directory; - -@end - -@implementation CDEManagedObjectSubclassesGenerator - -#pragma mark Creating -- (instancetype)initWithOutputDirectory:(NSURL *)initOutputDirectory modelPath:(NSURL *)initModelPath applicationFilesDirectory:(NSURL *)initApplicationFilesDirectory { - if(initOutputDirectory == nil || initModelPath == nil || initApplicationFilesDirectory == nil) { - self = nil; - return nil; - } - self = [super init]; - if(self) { - self.generateARCCompatibleCode = YES; - self.generateFetchResultsControllerCode = YES; - self.outputDirectory = initOutputDirectory; - self.modelPath = initModelPath; - self.applicationFilesDirectory = initApplicationFilesDirectory; - } - return self; -} - -- (instancetype)init { - return [self initWithOutputDirectory:nil modelPath:nil applicationFilesDirectory:nil]; -} - -#pragma mark Properties -- (NSURL *)readmeURL { - return [NSURL fileURLWithPath:[self.outputDirectory.path stringByAppendingPathComponent:@"Read me.rtf"]]; -} - -#pragma mark Generate the Subclasses -- (void)generate { - [self createTemplateFolderAndCopyTemplatesIfNeeded]; - @try { - NSString *mogeneratorBinaryPath = [[NSBundle mainBundle] pathForResource:@"mogenerator" ofType:[NSString string]]; - NSTask *task = [NSTask new]; - [task setLaunchPath:mogeneratorBinaryPath]; - NSString *outputMachinePath = [self.outputDirectory.path stringByAppendingPathComponent:@"Machine"]; - NSString *outputHumanPath = [self.outputDirectory.path stringByAppendingPathComponent:@"Human"]; - - NSMutableArray *arguments = [@[@"-m", self.modelPath.path, @"-M", outputMachinePath, @"-H", outputHumanPath] mutableCopy]; - - if(self.generateARCCompatibleCode) { - [arguments addObject:@"--template-var"]; - [arguments addObject:@"arc=true"]; - } - - if(self.generateFetchResultsControllerCode) { - [arguments addObject:@"--template-var"]; - [arguments addObject:@"frc=true"]; - } - - [task setArguments:arguments]; - - NSPipe *pipe = [NSPipe pipe]; - [task setStandardOutput:pipe]; - [task setStandardInput:[NSPipe pipe]]; - [task launch]; - - } @catch(NSException *ex) { - NSLog(@"WARNING couldn't launch mogenerator\n"); - } - - NSFileManager *fileManager = [NSFileManager new]; - NSString *sourceReadmePath = [[NSBundle mainBundle] pathForResource:@"mogeneratorReadme" ofType:@"rtf"]; - NSString *destinationReadmePath = [self.outputDirectory.path stringByAppendingPathComponent:@"Read me.rtf"]; - [fileManager copyItemAtPath:sourceReadmePath toPath:destinationReadmePath error:nil]; -} - -#pragma mark Dealloc -- (void)dealloc { - self.outputDirectory = nil; - self.modelPath = nil; - self.applicationFilesDirectory = nil; -} - -#pragma mark Private Methods - -- (NSString *)mogeneratorTemplatesDirectory { - return [self.applicationFilesDirectory.path stringByAppendingPathComponent:@"mogenerator-v-1-26-templates"]; -} - -- (void)createTemplateFolderAndCopyTemplatesIfNeeded { - NSString *templateDirectoryPath = [self mogeneratorTemplatesDirectory]; - - NSFileManager *fileManager = [NSFileManager new]; - if([fileManager fileExistsAtPath:templateDirectoryPath isDirectory:nil] == NO) { - [fileManager createDirectoryAtPath:templateDirectoryPath withIntermediateDirectories:YES attributes:nil error:nil]; - } - - NSString *motemplateType = @"motemplate"; - [self checkIfBundleResource:@"human.h" ofType:motemplateType existsInDirectoryAndCopyIfNeeded:templateDirectoryPath]; - [self checkIfBundleResource:@"human.m" ofType:motemplateType existsInDirectoryAndCopyIfNeeded:templateDirectoryPath]; - [self checkIfBundleResource:@"machine.h" ofType:motemplateType existsInDirectoryAndCopyIfNeeded:templateDirectoryPath]; - [self checkIfBundleResource:@"machine.m" ofType:motemplateType existsInDirectoryAndCopyIfNeeded:templateDirectoryPath]; -} - -- (void)checkIfBundleResource:(NSString *)resource ofType:(NSString *)type existsInDirectoryAndCopyIfNeeded:(NSString *)directory { - // NSBundle *bundle = [NSBundle mainBundle]; - // NSString *destinationTemplatePath = [directory stringByAppendingPathComponent:[resource stringByAppendingPathExtension:type]]; - // NSFileManager *fileManager = [NSFileManager new]; - // BOOL copyFile = ![fileManager fileExistsAtPath:destinationTemplatePath isDirectory:nil]; - // if(copyFile) { - // [fileManager copyItemAtPath:[bundle pathForResource:resource ofType:type] toPath:destinationTemplatePath error:nil]; - // } - -} - -@end diff --git a/Core Data Editor/Core Data Editor/CDEManagedObjectView.xib b/Core Data Editor/Core Data Editor/CDEManagedObjectView.xib index 0e49cec..1f5f10e 100644 --- a/Core Data Editor/Core Data Editor/CDEManagedObjectView.xib +++ b/Core Data Editor/Core Data Editor/CDEManagedObjectView.xib @@ -1,7 +1,6 @@ - @@ -49,7 +48,7 @@ - + diff --git a/Core Data Editor/Core Data Editor/CDEManagedObjectsPickerViewController.xib b/Core Data Editor/Core Data Editor/CDEManagedObjectsPickerViewController.xib index 6d43816..d29f70c 100644 --- a/Core Data Editor/Core Data Editor/CDEManagedObjectsPickerViewController.xib +++ b/Core Data Editor/Core Data Editor/CDEManagedObjectsPickerViewController.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDEManagedObjectsViewController.xib b/Core Data Editor/Core Data Editor/CDEManagedObjectsViewController.xib index a74d8f8..598a4e0 100644 --- a/Core Data Editor/Core Data Editor/CDEManagedObjectsViewController.xib +++ b/Core Data Editor/Core Data Editor/CDEManagedObjectsViewController.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDEModelChooserSheetController.m b/Core Data Editor/Core Data Editor/CDEModelChooserSheetController.m index 70431ba..4c9bd43 100644 --- a/Core Data Editor/Core Data Editor/CDEModelChooserSheetController.m +++ b/Core Data Editor/Core Data Editor/CDEModelChooserSheetController.m @@ -19,41 +19,41 @@ @implementation CDEModelChooserSheetController #pragma mark - Setting the displayed Model Chooser Items - (void)setDisplayedModelChooserItems:(NSArray *)modelChooserItems { - NSArray *items = modelChooserItems != nil ? modelChooserItems : @[]; - [self.modelItemsArrayController setContent:[NSMutableArray arrayWithArray:items]]; + NSArray *items = modelChooserItems != nil ? modelChooserItems : @[]; + [self.modelItemsArrayController setContent:[NSMutableArray arrayWithArray:items]]; } #pragma mark Actions - (IBAction)ok:(id)sender { - [NSApp endSheet:self.window]; - [self.window orderOut:sender]; - CDEModelChooserItem *selectedItem = [self.modelItemsArrayController.selectedObjects lastObject]; - (self.completionHandler)(CDEModelChooserSheetControllerResultOKButton, selectedItem); - self.completionHandler = nil; + [self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK]; + [self.window orderOut:sender]; + CDEModelChooserItem *selectedItem = [self.modelItemsArrayController.selectedObjects lastObject]; + (self.completionHandler)(CDEModelChooserSheetControllerResultOKButton, selectedItem); + self.completionHandler = nil; } - (IBAction)cancel:(id)sender { - [NSApp endSheet:self.window]; - [self.window orderOut:sender]; - (self.completionHandler)(CDEModelChooserSheetControllerResultCancelButton, nil); - self.completionHandler = nil; + [self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK]; + [self.window orderOut:sender]; + (self.completionHandler)(CDEModelChooserSheetControllerResultCancelButton, nil); + self.completionHandler = nil; } #pragma mark Creating - (id)init { - self = [super initWithWindowNibName:NSStringFromClass([self class])]; - if(self) { - self.completionHandler = nil; - } - return self; + self = [super initWithWindowNibName:NSStringFromClass([self class])]; + if(self) { + self.completionHandler = nil; + } + return self; } #pragma mark Running the Model Chooser - (void)beginSheetModalForWindow:(NSWindow *)parentWindow completionHandler:(CDEModelChooserSheetControllerCompletionHandler)handler { - if(self.completionHandler != nil) { - return; - } - self.completionHandler = handler; + if(self.completionHandler != nil) { + return; + } + self.completionHandler = handler; [parentWindow beginSheet:self.window completionHandler:^(NSModalResponse returnCode) { }]; @@ -61,13 +61,13 @@ - (void)beginSheetModalForWindow:(NSWindow *)parentWindow completionHandler:(CDE #pragma mark NSTableViewDelegate - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex { - if([[tableColumn identifier] isEqualToString:@"Icon"] == NO) { - return; - } - - CDEModelChooserItem *itemAtRow = (self.modelItemsArrayController.arrangedObjects)[rowIndex]; - NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:itemAtRow.URL.path]; - [cell setImage:icon]; + if([[tableColumn identifier] isEqualToString:@"Icon"] == NO) { + return; + } + + CDEModelChooserItem *itemAtRow = (self.modelItemsArrayController.arrangedObjects)[rowIndex]; + NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:itemAtRow.URL.path]; + [cell setImage:icon]; } @end diff --git a/Core Data Editor/Core Data Editor/CDEModelChooserSheetController.xib b/Core Data Editor/Core Data Editor/CDEModelChooserSheetController.xib index fcf548c..141704b 100644 --- a/Core Data Editor/Core Data Editor/CDEModelChooserSheetController.xib +++ b/Core Data Editor/Core Data Editor/CDEModelChooserSheetController.xib @@ -1,7 +1,6 @@ - @@ -13,7 +12,7 @@ - + @@ -27,7 +26,7 @@ - + diff --git a/Core Data Editor/Core Data Editor/CDENumberAttributeView.xib b/Core Data Editor/Core Data Editor/CDENumberAttributeView.xib index ba0bdbd..48d0bd7 100644 --- a/Core Data Editor/Core Data Editor/CDENumberAttributeView.xib +++ b/Core Data Editor/Core Data Editor/CDENumberAttributeView.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDENumberAttributeViewController.m b/Core Data Editor/Core Data Editor/CDENumberAttributeViewController.m index 4b23f9c..2107a61 100644 --- a/Core Data Editor/Core Data Editor/CDENumberAttributeViewController.m +++ b/Core Data Editor/Core Data Editor/CDENumberAttributeViewController.m @@ -32,7 +32,7 @@ - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor NSAlert *alert = [NSAlert new]; alert.informativeText = [NSString stringWithFormat:@"Input '%@' does not match validation predicates:\n\n%@", [fieldEditor string], [predicate description]]; alert.messageText = @"Validation Error"; - alert.alertStyle = NSCriticalAlertStyle; + alert.alertStyle = NSAlertStyleCritical; [alert runModal]; return NO; } diff --git a/Core Data Editor/Core Data Editor/CDEPathPickerPopUpButton.m b/Core Data Editor/Core Data Editor/CDEPathPickerPopUpButton.m index 5723eae..f9c278f 100644 --- a/Core Data Editor/Core Data Editor/CDEPathPickerPopUpButton.m +++ b/Core Data Editor/Core Data Editor/CDEPathPickerPopUpButton.m @@ -2,69 +2,54 @@ @implementation CDEPathPickerPopUpButton -- (id)initWithFrame:(NSRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - // Initialization code here. - } - - return self; -} - -- (id)initWithCoder:(NSCoder *)decoder { - self = [super initWithCoder:decoder]; - return self; -} - #pragma mark - Nib - (void)awakeFromNib { - [super awakeFromNib]; - [self createDefaultMenuItems]; - self.URL = nil; + [super awakeFromNib]; + [self createDefaultMenuItems]; + self.URL = nil; } #pragma mark - Properties - (void)setURL:(NSURL *)URL { - _URL = URL; - if(self.URL == nil) { - [self showPlaceholderInBuildDirectoryPopUpButton]; - } else { - [self showURLInBuildDirectoryPopUpButton:self.URL]; - } + _URL = URL; + if(self.URL == nil) { + [self showPlaceholderInBuildDirectoryPopUpButton]; + } else { + [self showURLInBuildDirectoryPopUpButton:self.URL]; + } } #pragma mark - Helper - (void)createDefaultMenuItems { - NSMenuItem *directoryItem = [self.menu insertItemWithTitle:@"No Directory Set" action:NULL keyEquivalent:@"" atIndex:0]; - directoryItem.tag = 0; - [directoryItem setEnabled:NO]; - [self.menu insertItem:[NSMenuItem separatorItem] atIndex:1]; - NSMenuItem *otherItem = [self.menu insertItemWithTitle:@"Other…" action:@selector(otherItemSelected:) keyEquivalent:@"" atIndex:2]; - otherItem.target = self; + NSMenuItem *directoryItem = [self.menu insertItemWithTitle:@"No Directory Set" action:NULL keyEquivalent:@"" atIndex:0]; + directoryItem.tag = 0; + [directoryItem setEnabled:NO]; + [self.menu insertItem:[NSMenuItem separatorItem] atIndex:1]; + NSMenuItem *otherItem = [self.menu insertItemWithTitle:@"Other…" action:@selector(otherItemSelected:) keyEquivalent:@"" atIndex:2]; + otherItem.target = self; } - (void)otherItemSelected:(NSMenuItem *)sender { - self.otherItemSelectedHandler ? self.otherItemSelectedHandler(self) : nil; - [self selectItemAtIndex:0]; + self.otherItemSelectedHandler ? self.otherItemSelectedHandler(self) : nil; + [self selectItemAtIndex:0]; } - (void)showPlaceholderInBuildDirectoryPopUpButton { - NSMenuItem *item = [self.menu itemWithTag:0]; - item.title = @"No Directory Set"; - [item setEnabled:NO]; - [item setImage:nil]; - [self selectItemWithTag:0]; + NSMenuItem *item = [self.menu itemWithTag:0]; + item.title = @"No Directory Set"; + [item setEnabled:NO]; + [item setImage:nil]; + [self selectItemWithTag:0]; } - (void)showURLInBuildDirectoryPopUpButton:(NSURL *)URL { - NSMenuItem *item = [self.menu itemWithTag:0]; - item.title = [URL lastPathComponent]; - [item setEnabled:YES]; - NSImage *directoryImage = [NSImage imageNamed:NSImageNameFolder]; - directoryImage.size = NSMakeSize(16, 16); - [item setImage:directoryImage]; - [self selectItemWithTag:0]; + NSMenuItem *item = [self.menu itemWithTag:0]; + item.title = [URL lastPathComponent]; + [item setEnabled:YES]; + NSImage *directoryImage = [NSImage imageNamed:NSImageNameFolder]; + directoryImage.size = NSMakeSize(16, 16); + [item setImage:directoryImage]; + [self selectItemWithTag:0]; } @end diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.h b/Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.h deleted file mode 100644 index f05e5d6..0000000 --- a/Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface CDEPreferencesAutomaticProjectCreationViewController : NSViewController - -- (void)displayInfoSheet; - -@end diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.xib b/Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.xib deleted file mode 100644 index 8d8004b..0000000 --- a/Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.xib +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - If you tell Core Data Editor where your derived data directory is you can then drop store files on the dock icon and Core Data Editor will automatically try to find a matching model by looking at every model (recursively) in your derived data directory. The derived data directory is usually located at ~/Library/Developer/Xcode/DerivedData. - - - - - - - - - - Please specify your iPhone Simulator directory. This directory is usually located in ~/Library/Developer/CoreSimulator/. Specifying your iPhone Simulator directory enables the project browser feature. The project browser automatically finds compatible SQLite stores and managed object models and let's you quickly create a Core Data Editor projects. You access the project browser from the "Window | Project Browser" menu item. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.h b/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.h deleted file mode 100644 index 916b20d..0000000 --- a/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// CDECDEPreferencesFormattingViewController.h -// Core Data Editor -// -// Created by cmk on 7/21/13. -// Copyright (c) 2013 Christian Kienle. All rights reserved. -// - -#import - -@interface CDEPreferencesFormattingViewController : NSViewController - -@end diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.m b/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.m deleted file mode 100644 index c9da950..0000000 --- a/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// CDECDEPreferencesFormattingViewController.m -// Core Data Editor -// -// Created by cmk on 7/21/13. -// Copyright (c) 2013 Christian Kienle. All rights reserved. -// - -#import "CDEPreferencesFormattingViewController.h" - -@interface CDEPreferencesFormattingViewController () - -@end - -@implementation CDEPreferencesFormattingViewController - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Initialization code here. - } - - return self; -} - -@end diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.xib b/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.xib deleted file mode 100644 index e5e9f01..0000000 --- a/Core Data Editor/Core Data Editor/CDEPreferencesFormattingViewController.xib +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.xib b/Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.xib deleted file mode 100644 index 7faf72a..0000000 --- a/Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.xib +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesWindowController.m b/Core Data Editor/Core Data Editor/CDEPreferencesWindowController.m deleted file mode 100644 index 095a00a..0000000 --- a/Core Data Editor/Core Data Editor/CDEPreferencesWindowController.m +++ /dev/null @@ -1,171 +0,0 @@ -#import "CDEPreferencesWindowController.h" -#import "NSUserDefaults+CDEAdditions.h" -#import "NSURL+CDEAdditions.h" - -#import "CDEPreferencesAutomaticProjectCreationViewController.h" - -@interface CDEPreferencesWindowController () - -#pragma mark - Properties -@property (nonatomic, copy) CDEPreferencesWindowControllerCompletionHandler completionHandler; - -#pragma mark - Tabbed Preferences -@property (nonatomic, strong, readwrite) NSArray *viewControllers; -@property (nonatomic, strong) NSViewController *currentViewController; -@property (nonatomic, strong) NSToolbarItem *currentToolbarItem; - - -@end - -@implementation CDEPreferencesWindowController - -#pragma mark - Creating -- (instancetype)init { - self = [super initWithWindowNibName:@"CDEPreferencesWindowController"]; - if(self) { - - } - return self; -} - -#pragma mark - NSWindowController -- (void)windowDidLoad { - [super windowDidLoad]; - [self createToolbarItemsToViewControllerMapping]; -} - -#pragma mark - Showing the Preferences Window -- (void)showWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler { - self.completionHandler = handler; - [self showWindow:self]; -} - -- (void)showAutomaticProjectCreationPreferencesAndDisplayInfoSheetWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler { - [self showAutomaticProjectCreationPreferencesWithCompletionHandler:handler]; - double delayInSeconds = 0.5; - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ - NSString *identifier = NSStringFromClass([CDEPreferencesAutomaticProjectCreationViewController class]); - CDEPreferencesAutomaticProjectCreationViewController *viewController = (CDEPreferencesAutomaticProjectCreationViewController *)[self existingViewControllerForToolbarItemWithIdentifier:identifier]; - [viewController displayInfoSheet]; - }); -} - -- (void)showAutomaticProjectCreationPreferencesWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler { - self.completionHandler = handler; - [self showWindow:self]; - NSString *identifier = NSStringFromClass([CDEPreferencesAutomaticProjectCreationViewController class]); - CDEPreferencesAutomaticProjectCreationViewController *viewController = (CDEPreferencesAutomaticProjectCreationViewController *)[self existingViewControllerForToolbarItemWithIdentifier:identifier]; - [self showViewController:viewController]; -} - -- (IBAction)dismiss:(id)sender { - [self.window performClose:self]; -} - -- (void)windowWillClose:(NSNotification *)notification { - self.completionHandler ? self.completionHandler() : nil; -} - -#pragma mark - Tabbed Preferences -- (void)createToolbarItemsToViewControllerMapping { - self.viewControllers = @[]; - - if(self.window == nil) { - NSLog(@"A preferences controller cannot work without a window. Connect the window outlet to your preferences window."); - return; - } - if(self.window.toolbar == nil) { - NSLog(@"A preferences controller cannot work without a toolbar."); - return; - } - - NSToolbarItem *firstItem = nil; - for(NSToolbarItem *visibleItem in self.window.toolbar.visibleItems) { - if(!visibleItem.isEnabled || visibleItem.target != self) { - continue; - } - NSViewController *controller = [self createViewControllerForToolbarItem:visibleItem]; - if(controller == nil) { - continue; - } - self.viewControllers = [self.viewControllers arrayByAddingObject:controller]; - if(firstItem == nil) { - firstItem = visibleItem; - } - } - if(firstItem != nil) { - [self.window.toolbar setSelectedItemIdentifier:firstItem.itemIdentifier]; - [self showPreferencesFor:firstItem]; - } -} - -- (NSViewController *)createViewControllerForToolbarItem:(NSToolbarItem *)item { - if(item == nil) { - return nil; - } - NSString *identifier = item.itemIdentifier; - NSViewController *result = [[NSClassFromString(identifier) alloc] initWithNibName:identifier bundle:nil]; - if(result == nil) { - return nil; - } - [result view]; - return result; -} - -- (NSViewController *)existingViewControllerForToolbarItemWithIdentifier:(NSString *)identifier { - if(identifier == nil) { - return nil; - } - for(NSViewController *viewController in self.viewControllers) { - if([viewController.nibName isEqualToString:identifier]) { - return viewController; - } - } - return nil; -} - -- (NSViewController *)existingViewControllerForToolbarItem:(NSToolbarItem *)item { - return [self existingViewControllerForToolbarItemWithIdentifier:item.itemIdentifier]; -} - -- (void)showViewController:(NSViewController *)newViewController { - if(self.currentViewController == nil) { - CGFloat deltaHeight = NSHeight([self.window.contentView bounds]) - NSHeight(newViewController.view.frame); - CGFloat deltaWidth = NSWidth([self.window.contentView bounds]) - NSWidth(newViewController.view.frame); - - NSRect newWindowFrame = self.window.frame; - - newWindowFrame.size.height -= deltaHeight; - newWindowFrame.size.width -= deltaWidth; - newWindowFrame.origin.y += deltaHeight; - [self.window setFrame:newWindowFrame display:YES animate:YES]; - [self.window.contentView addSubview:newViewController.view]; - - self.currentViewController = newViewController; - [self.window.toolbar setSelectedItemIdentifier:NSStringFromClass([newViewController class])]; - return; - } - - [self.currentViewController.view removeFromSuperview]; - - CGFloat deltaHeight = NSHeight(self.currentViewController.view.frame) - NSHeight(newViewController.view.frame); - CGFloat deltaWidth = NSWidth(self.currentViewController.view.frame) - NSWidth(newViewController.view.frame); - - NSRect newWindowFrame = self.window.frame; - - newWindowFrame.size.height -= deltaHeight; - newWindowFrame.size.width -= deltaWidth; - newWindowFrame.origin.y += deltaHeight; - [self.window setFrame:newWindowFrame display:YES animate:YES]; - [self.window.contentView addSubview:newViewController.view]; - self.currentViewController = newViewController; - [self.window.toolbar setSelectedItemIdentifier:NSStringFromClass([newViewController class])]; -} -- (IBAction)showPreferencesFor:(id)sender { - NSViewController *newViewController = [self existingViewControllerForToolbarItem:sender]; - [self showViewController:newViewController]; -} - - -@end diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesWindowController.xib b/Core Data Editor/Core Data Editor/CDEPreferencesWindowController.xib deleted file mode 100644 index de3fa89..0000000 --- a/Core Data Editor/Core Data Editor/CDEPreferencesWindowController.xib +++ /dev/null @@ -1,401 +0,0 @@ - - - - 1080 - 12E55 - 3084 - 1187.39 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 3084 - - - NSCustomObject - NSToolbar - NSToolbarFlexibleSpaceItem - NSToolbarItem - NSToolbarSpaceItem - NSUserDefaultsController - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - CDEPreferencesWindowController - - - FirstResponder - - - NSApplication - - - 3 - 2 - {{196, 240}, {478, 166}} - 1618477056 - Preferences - NSWindow - - - 14ED31DD-BB07-4844-A8D9-55464A02CABC - - - YES - YES - NO - NO - 1 - 1 - - - - 2EA9D6EA-E917-4FA7-9421-02F7F23F3125 - - Formatting - Formatting - - - - NSImage - formatting-icon - - - - {0, 0} - {0, 0} - YES - YES - -1 - YES - 0 - - - - AFCAF20C-AA03-46F4-B20C-151019C0A1D9 - - General - General - - - - NSImage - NSPreferencesGeneral - - - - {0, 0} - {0, 0} - YES - YES - -1 - YES - 0 - - - - BC505480-DBD0-40D2-91E1-FBD1FDD9E52A - - Integration - Integration - - - - NSImage - integration-icon - - - - {0, 0} - {0, 0} - YES - YES - -1 - YES - 0 - - - NSToolbarFlexibleSpaceItem - - Flexible Space - - - - - - {1, 5} - {20000, 32} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - - - - NSToolbarSpaceItem - - Space - - - - - - {32, 5} - {32, 32} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - - - - - - - - - - - - - - - - - - - - - - - 256 - - {478, 166} - - - - - {{0, 0}, {1920, 1058}} - {10000000000000, 10000000000000} - YES - - - YES - - - - - - - window - - - - 3 - - - - showPreferencesFor: - - - - 280 - - - - showPreferencesFor: - - - - 281 - - - - showPreferencesFor: - - - - 282 - - - - delegate - - - - 4 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - - 2 - - - - - - 26 - - - - - 270 - - - - - - - - - - - - 271 - - - - - 274 - - - - - 276 - - - - - 278 - - - - - 279 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - {{357, 418}, {480, 270}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - CDEPreferencesAutomaticProjectCreationViewController - - com.apple.InterfaceBuilder.CocoaPlugin - CDEPreferencesFormattingViewController - - com.apple.InterfaceBuilder.CocoaPlugin - CDEPreferencesMiscViewController - - - - - - - 282 - - - - - CDEPreferencesWindowController - NSWindowController - - IBProjectSource - ./Classes/CDEPreferencesWindowController.h - - - - - 0 - IBCocoaFramework - YES - 3 - - {11, 11} - {10, 3} - {32, 32} - {32, 32} - {32, 32} - - - diff --git a/Core Data Editor/Core Data Editor/CDEProjectBrowserWindowController.m b/Core Data Editor/Core Data Editor/CDEProjectBrowserWindowController.m index f6911f6..9d0c646 100644 --- a/Core Data Editor/Core Data Editor/CDEProjectBrowserWindowController.m +++ b/Core Data Editor/Core Data Editor/CDEProjectBrowserWindowController.m @@ -12,6 +12,33 @@ typedef void(^ProjectBrowserReloadCompletionHandler)(NSArray *projectBrowserItems /* CDEProjectBrowserItem */); +@interface _ProjectBrowserItem: NSObject + +@property (copy) NSString *modificationDate; +@property (copy) NSString *storePath; +@property (copy) NSString *modelPath; +@end + +@implementation _ProjectBrowserItem + +- (instancetype)initWithModificationDate:(NSString *)modificationDate storePath:(NSString *)storePath modelPath:(NSString *)modelPath { + self = [super init]; + self.modificationDate = modificationDate; + self.storePath = storePath; + self.modelPath = modelPath; + return self; +} + +- (instancetype)init { + @throw [NSException exceptionWithName:NSInternalInconsistencyException + reason:@"-init is not a valid initializer for the class _Project" + userInfo:nil]; +} + +@end + + + @interface CDEProjectBrowserWindowController () #pragma mark - Properties @@ -29,198 +56,197 @@ @implementation CDEProjectBrowserWindowController #pragma mark - Working with the project browser - (void)showWithProjectDirectoryURL:(NSURL *)projectDirectoryURL { - self.projectDirectoryURL = projectDirectoryURL; - [self showWindow:self]; - [self updateUI]; - [self reloadProjectBrowser:self]; + self.projectDirectoryURL = projectDirectoryURL; + [self showWindow:self]; + [self updateUI]; + [self reloadProjectBrowser:self]; } - (void)updateProjectDirectoryURL:(NSURL *)projectDirectoryURL { - self.projectDirectoryURL = projectDirectoryURL; - [self reloadProjectBrowser:self]; + self.projectDirectoryURL = projectDirectoryURL; + [self reloadProjectBrowser:self]; } - (void)updateUI { - [self.reloadButton setEnabled:(self.projectDirectoryURL != nil)]; + [self.reloadButton setEnabled:(self.projectDirectoryURL != nil)]; } #pragma mark - Actions - (IBAction)createProject:(id)sender { - NSInteger row = [self.tableView rowForView:sender]; - if(row == -1) { - return; - } - CDEProjectBrowserItem *item = [self.items.arrangedObjects objectAtIndex:row]; - - if(item == nil) { - return; - } - CDEDocument *document = [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:NO error:NULL]; - CDEConfiguration *c = [document createConfiguration]; - NSError *error = nil; - NSURL *storeURL = [NSURL fileURLWithPath:item.storePath]; - NSURL *modelURL = [NSURL fileURLWithPath:item.modelPath]; - - BOOL set = [c setBookmarkDataWithApplicationBundleURL:nil storeURL:storeURL modelURL:modelURL error:&error]; - if(!set) { - NSLog(@"error: %@", error); - } - error = nil; - BOOL setup = [document setupAndStartAccessingConfigurationRelatedURLsAndGetError:&error]; - if(!setup) { - NSLog(@"error: %@", error); - } - [document makeWindowControllers]; - [document showWindows]; + NSInteger row = [self.tableView rowForView:sender]; + if(row == -1) { + return; + } + CDEProjectBrowserItem *item = [self.items.arrangedObjects objectAtIndex:row]; + + if(item == nil) { + return; + } + CDEDocument *document = [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:NO error:NULL]; + CDEConfiguration *c = [document createConfiguration]; + NSError *error = nil; + NSURL *storeURL = [NSURL fileURLWithPath:item.storePath]; + NSURL *modelURL = [NSURL fileURLWithPath:item.modelPath]; + + BOOL set = [c setBookmarkDataWithApplicationBundleURL:nil storeURL:storeURL modelURL:modelURL error:&error]; + if(!set) { + NSLog(@"error: %@", error); + } + error = nil; + BOOL setup = [document setupAndStartAccessingConfigurationRelatedURLsAndGetError:&error]; + if(!setup) { + NSLog(@"error: %@", error); + } + [document makeWindowControllers]; + [document showWindows]; } - (void)prepareUIForReload { - [self.items setContent:[@[] mutableCopy]]; - [self.reloadButton setEnabled:NO]; - [self.reloadProgressIndicator startAnimation:self]; + [self.items setContent:[@[] mutableCopy]]; + [self.reloadButton setEnabled:NO]; + [self.reloadProgressIndicator startAnimation:self]; } - (void)performReloadWithCompletionHandler:(ProjectBrowserReloadCompletionHandler)completionHandler { - NSParameterAssert(completionHandler); - NSAssert(self.projectDirectoryURL != nil, @""); + NSParameterAssert(completionHandler); + NSAssert(self.projectDirectoryURL != nil, @""); + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + NSDirectoryEnumerator *enumerator = [self newSimulatorDirectoryEnumerator]; + + NSDictionary *metadataByStorePath; + NSDictionary *modelByModelPath; + + [enumerator getMetadataByStorePath:&metadataByStorePath modelByModelPath:&modelByModelPath]; + + NSArray *items = [self compatibleProjectBrowserItemsWithMetadataByStorePath:metadataByStorePath modelByModelPath:modelByModelPath]; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSDirectoryEnumerator *enumerator = [self newSimulatorDirectoryEnumerator]; + double delayInSeconds = 1.0; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + completionHandler(items); + }); + }); +} + + + +- (NSArray *)compatibleProjectBrowserItemsWithMetadataByStorePath:(NSDictionary *)metadataByStorePath modelByModelPath:(NSDictionary*)modelByModelPath { + NSMutableArray *items = [NSMutableArray new]; + NSMutableArray<_ProjectBrowserItem*> *projectItems = [NSMutableArray new]; + // Find compatible combinations + [modelByModelPath enumerateKeysAndObjectsUsingBlock:^(NSString *modelPath, NSManagedObjectModel *model, BOOL *stop) { + [metadataByStorePath enumerateKeysAndObjectsUsingBlock:^(NSString *storePath, NSDictionary *metadata, BOOL *stop) { + BOOL isCompatible = [model isConfiguration:nil compatibleWithStoreMetadata:metadata]; + if(isCompatible) { + NSDate *storeModDate; + NSURL *storeURL=[NSURL fileURLWithPath:storePath]; + NSError *error; + [storeURL getResourceValue:&storeModDate forKey:NSURLContentModificationDateKey error:&error]; - NSDictionary *metadataByStorePath; - NSDictionary *modelByModelPath; + //Also look for: .sqlite-wal (write-ahead log). Use most recent, although the wal should be most recent if found. + NSString *walPath=[NSString stringWithFormat:@"%@-wal",storeURL.absoluteString]; + NSURL *walUrl=[NSURL URLWithString:walPath]; + NSDate *walModDate; + [walUrl getResourceValue:&walModDate forKey:NSURLContentModificationDateKey error:&error]; - [enumerator getMetadataByStorePath:&metadataByStorePath modelByModelPath:&modelByModelPath]; + if ([storeModDate compare:walModDate]==NSOrderedAscending) { + storeModDate=walModDate; + } - NSArray *items = [self compatibleProjectBrowserItemsWithMetadataByStorePath:metadataByStorePath modelByModelPath:modelByModelPath]; + NSDate *modelModDate; + NSURL *modelURL=[NSURL fileURLWithPath:modelPath]; + [modelURL getResourceValue:&modelModDate forKey:NSURLContentModificationDateKey error:&error]; - double delayInSeconds = 1.0; - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ - completionHandler(items); - }); - }); -} - -- (NSArray *)compatibleProjectBrowserItemsWithMetadataByStorePath:(NSDictionary *)metadataByStorePath modelByModelPath:(NSDictionary*)modelByModelPath { - NSMutableArray *items = [NSMutableArray new]; - NSMutableArray *itemsWithDates= [NSMutableArray new]; // Each element is dictionary with {modificationDate:, storePath:, modelPath} - - // Find compatible combinations - [modelByModelPath enumerateKeysAndObjectsUsingBlock:^(NSString *modelPath, NSManagedObjectModel *model, BOOL *stop) { - [metadataByStorePath enumerateKeysAndObjectsUsingBlock:^(NSString *storePath, NSDictionary *metadata, BOOL *stop) { - BOOL isCompatible = [model isConfiguration:nil compatibleWithStoreMetadata:metadata]; - if(isCompatible) { - NSDate *storeModDate; - NSURL *storeURL=[NSURL fileURLWithPath:storePath]; - NSError *error; - [storeURL getResourceValue:&storeModDate forKey:NSURLContentModificationDateKey error:&error]; - - //Also look for: .sqlite-wal (write-ahead log). Use most recent, although the wal should be most recent if found. - NSString *walPath=[NSString stringWithFormat:@"%@-wal",storeURL.absoluteString]; - NSURL *walUrl=[NSURL URLWithString:walPath]; - NSDate *walModDate; - [walUrl getResourceValue:&walModDate forKey:NSURLContentModificationDateKey error:&error]; - - if ([storeModDate compare:walModDate]==NSOrderedAscending) { - storeModDate=walModDate; - } - - NSDate *modelModDate; - NSURL *modelURL=[NSURL fileURLWithPath:modelPath]; - [modelURL getResourceValue:&modelModDate forKey:NSURLContentModificationDateKey error:&error]; - - //NSSortDescriptor doesn't do NSDate, so use a string. Both dates concatenated for nesting. - NSString *fileModDateString=[NSString stringWithFormat:@"%@ - %@",storeModDate,modelModDate]; - - NSDictionary *itemWithDate=@{kCDEFileModificationDateKey: fileModDateString, - kCDEStorePathKey: storePath, - kCDEModelPathKey: modelPath}; - - [itemsWithDates addObject:itemWithDate]; - } - }]; + //NSSortDescriptor doesn't do NSDate, so use a string. Both dates concatenated for nesting. + NSString *fileModDateString = [NSString stringWithFormat:@"%@ - %@",storeModDate, modelModDate]; + + _ProjectBrowserItem *item = [[_ProjectBrowserItem alloc] initWithModificationDate:fileModDateString storePath:storePath modelPath:modelPath]; + + [projectItems addObject:item]; + } }]; - //Now sort and display - NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:kCDEFileModificationDateKey ascending:NO]; - NSArray *itemsSorted=[itemsWithDates sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]]; - - for (NSDictionary *itemWithDate in itemsSorted) { - NSString *storePath=itemWithDate[kCDEStorePathKey]; - NSString *modelPath=itemWithDate[kCDEModelPathKey]; - CDEProjectBrowserItem *item = [[CDEProjectBrowserItem alloc] initWithStorePath:storePath modelPath:modelPath]; - [items addObject:item]; - } - - return items; + }]; + //Now sort and display + NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:kCDEFileModificationDateKey ascending:NO]; + NSArray<_ProjectBrowserItem*> *itemsSorted = [projectItems sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]]; + + for (_ProjectBrowserItem *item in itemsSorted) { + NSString *storePath = item.storePath; + NSString *modelPath = item.modelPath; + CDEProjectBrowserItem *item = [[CDEProjectBrowserItem alloc] initWithStorePath:storePath modelPath:modelPath]; + [items addObject:item]; + } + + return items; } - (NSDirectoryEnumerator *)newSimulatorDirectoryEnumerator { - NSFileManager *fileManager = [NSFileManager defaultManager]; // there is no reason not to use the defaultManager - NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:self.projectDirectoryURL includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles errorHandler:^BOOL(NSURL *url, NSError *error) { - NSLog(@"error while enumerating contents of simulator directory: %@", error); - return YES; - }]; - return enumerator; + NSFileManager *fileManager = [NSFileManager defaultManager]; // there is no reason not to use the defaultManager + NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:self.projectDirectoryURL includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles errorHandler:^BOOL(NSURL *url, NSError *error) { + NSLog(@"error while enumerating contents of simulator directory: %@", error); + return YES; + }]; + return enumerator; } - (IBAction)reloadProjectBrowser:(id)sender { - NSURL *simulatorURL = self.projectDirectoryURL; - if(simulatorURL == nil) { - NSLog(@"simulator url is nil"); - [self displayDelayedNoSimulatorDirectoryAlert]; - return; - } - - [self prepareUIForReload]; - - [self performReloadWithCompletionHandler:^(NSArray *projectBrowserItems) { - [self.items setContent:projectBrowserItems]; - [self.reloadButton setEnabled:YES]; - [self.reloadProgressIndicator stopAnimation:self]; - }]; + NSURL *simulatorURL = self.projectDirectoryURL; + if(simulatorURL == nil) { + NSLog(@"simulator url is nil"); + [self displayDelayedNoSimulatorDirectoryAlert]; + return; + } + + [self prepareUIForReload]; + + [self performReloadWithCompletionHandler:^(NSArray *projectBrowserItems) { + [self.items setContent:projectBrowserItems]; + [self.reloadButton setEnabled:YES]; + [self.reloadProgressIndicator stopAnimation:self]; + }]; } #pragma mark - Helper - (void)displayDelayedNoSimulatorDirectoryAlert { - double delayInSeconds = 2.0; - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ - NSAlert *alert = [NSAlert new]; - alert.messageText = @"iPhone Simulator Directory not set"; - alert.informativeText = @"The Project Browser has to know where the iPhone Simulator directory is. Please go to the preferences and specify your iPhone Simulator directory in the Integration tab."; - [alert addButtonWithTitle:@"Open Preferences…"]; - [alert addButtonWithTitle:@"Close Project Browser"]; - alert.alertStyle = NSInformationalAlertStyle; - [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) { - if(returnCode == NSAlertFirstButtonReturn) { - // show prefs. - [(CDEApplicationDelegate *)[NSApp delegate] showPreferences:self]; - } - [self closeWindowSoon]; - }]; - }); + double delayInSeconds = 2.0; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + NSAlert *alert = [NSAlert new]; + alert.messageText = @"iPhone Simulator Directory not set"; + alert.informativeText = @"The Project Browser has to know where the iPhone Simulator directory is. Please go to the preferences and specify your iPhone Simulator directory in the Integration tab."; + [alert addButtonWithTitle:@"Open Preferences…"]; + [alert addButtonWithTitle:@"Close Project Browser"]; + alert.alertStyle = NSAlertStyleInformational; + [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) { + if(returnCode == NSAlertFirstButtonReturn) { + // show prefs. + [(CDEApplicationDelegate *)[NSApp delegate] showPreferences:self]; + } + [self closeWindowSoon]; + }]; + }); } - (void)closeWindowSoon { - double delayInSeconds = 2.0; - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ - [self.window performClose:self]; - }); + double delayInSeconds = 2.0; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + [self.window performClose:self]; + }); } #pragma mark - NSWindowController - (instancetype)init { - self = [super initWithWindowNibName:@"CDEProjectBrowserWindowController" owner:self]; - if(self) { - - } - return self; + self = [super initWithWindowNibName:@"CDEProjectBrowserWindowController" owner:self]; + if(self) { + + } + return self; } - (void)windowDidLoad { - [super windowDidLoad]; + [super windowDidLoad]; } @end diff --git a/Core Data Editor/Core Data Editor/CDEProjectBrowserWindowController.xib b/Core Data Editor/Core Data Editor/CDEProjectBrowserWindowController.xib index 18fe828..8c8cebd 100644 --- a/Core Data Editor/Core Data Editor/CDEProjectBrowserWindowController.xib +++ b/Core Data Editor/Core Data Editor/CDEProjectBrowserWindowController.xib @@ -1,7 +1,6 @@ - @@ -29,7 +28,7 @@ - + diff --git a/Core Data Editor/Core Data Editor/CDERelationshipsViewController.m b/Core Data Editor/Core Data Editor/CDERelationshipsViewController.m index ce4e8ce..c520e53 100644 --- a/Core Data Editor/Core Data Editor/CDERelationshipsViewController.m +++ b/Core Data Editor/Core Data Editor/CDERelationshipsViewController.m @@ -134,8 +134,8 @@ - (BOOL)performKeyEquivalent:(NSEvent *)event { // '8' => code: 28 7 // '9' => code: 25 8 // '0' => code: 29 9 - NSUInteger flags = [event modifierFlags] & NSDeviceIndependentModifierFlagsMask; - if( flags == NSCommandKeyMask ){ + NSUInteger flags = [event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask; + if( flags == NSEventModifierFlagCommand ){ unsigned short keyCode = [event keyCode]; NSDictionary *itemIndexesByKeyCode = @{ @18 : @0, diff --git a/Core Data Editor/Core Data Editor/CDERelationshipsViewController.xib b/Core Data Editor/Core Data Editor/CDERelationshipsViewController.xib index e361f53..415418d 100644 --- a/Core Data Editor/Core Data Editor/CDERelationshipsViewController.xib +++ b/Core Data Editor/Core Data Editor/CDERelationshipsViewController.xib @@ -1,7 +1,6 @@ - @@ -21,7 +20,7 @@ - + diff --git a/Core Data Editor/Core Data Editor/CDESetupWindowController.m b/Core Data Editor/Core Data Editor/CDESetupWindowController.m index 18c53ec..1e4ea9d 100644 --- a/Core Data Editor/Core Data Editor/CDESetupWindowController.m +++ b/Core Data Editor/Core Data Editor/CDESetupWindowController.m @@ -15,14 +15,11 @@ @implementation CDESetupWindowController - (instancetype)init { self = [super initWithWindowNibName:@"CDESetupWindowController" owner:self]; - if(self) { - - } + if(self) { } return self; } -- (void)windowDidLoad -{ +- (void)windowDidLoad { [super windowDidLoad]; self.simulatorPathPopupButton.otherItemSelectedHandler = ^(CDEPathPickerPopUpButton *sender) { @@ -33,7 +30,6 @@ - (void)windowDidLoad }; } - - (IBAction)showSimulatorDirectoryPicker:(id)sender { NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel setCanChooseDirectories:YES]; @@ -61,7 +57,6 @@ - (IBAction)showDerivdedDataPicker:(id)sender { }]; } - #pragma mark - Actions - (IBAction)beginSetupProcess:(id)sender { [self.tabView selectNextTabViewItem:sender]; diff --git a/Core Data Editor/Core Data Editor/CDESetupWindowController.xib b/Core Data Editor/Core Data Editor/CDESetupWindowController.xib index a62d60f..532b952 100644 --- a/Core Data Editor/Core Data Editor/CDESetupWindowController.xib +++ b/Core Data Editor/Core Data Editor/CDESetupWindowController.xib @@ -1,7 +1,9 @@ - - + + - + + + @@ -30,7 +32,7 @@ - + @@ -120,7 +122,7 @@ - Please specify your iPhone Simulator directory. This directory is usually located in ~/Library/Developer/CoreSimulator/. Specifying your iPhone Simulator directory enables the project browser feature. The project browser automatically finds compatible SQLite stores and managed object models and let's you quickly create a Core Data Editor projects. You access the project browser from the "Window | Project Browser" menu item. + Please specify your iPhone Simulator directory. This directory is usually located in ~/Library/Application Support/iPhone Simulator/. Specifying your iPhone Simulator directory enables the project browser feature. The project browser automatically finds compatible SQLite stores and managed object models and let's you quickly create a Core Data Editor projects. You access the project browser from the "Window | Project Browser" menu item. @@ -147,12 +149,9 @@ - + - - - @@ -165,7 +164,7 @@ - + @@ -231,12 +230,9 @@ - + - - - diff --git a/Core Data Editor/Core Data Editor/CDEStringAttributeView.xib b/Core Data Editor/Core Data Editor/CDEStringAttributeView.xib index 58435d8..29fd0b9 100644 --- a/Core Data Editor/Core Data Editor/CDEStringAttributeView.xib +++ b/Core Data Editor/Core Data Editor/CDEStringAttributeView.xib @@ -1,7 +1,6 @@ - diff --git a/Core Data Editor/Core Data Editor/CDETextEditorViewController.xib b/Core Data Editor/Core Data Editor/CDETextEditorViewController.xib index 132c2b0..11ec12b 100644 --- a/Core Data Editor/Core Data Editor/CDETextEditorViewController.xib +++ b/Core Data Editor/Core Data Editor/CDETextEditorViewController.xib @@ -1,7 +1,6 @@ - @@ -21,7 +20,7 @@ - + diff --git a/Core Data Editor/Core Data Editor/CDEValidationErrorsViewController.m b/Core Data Editor/Core Data Editor/CDEValidationErrorsViewController.m index 97364fb..4526a81 100644 --- a/Core Data Editor/Core Data Editor/CDEValidationErrorsViewController.m +++ b/Core Data Editor/Core Data Editor/CDEValidationErrorsViewController.m @@ -3,19 +3,19 @@ #import "NSError+CDEValidation.h" @interface NSManagedObjectContext (CDEValidationErrorsViewController) -@property (nonatomic, readonly) NSSet *changedObjects_cde; +@property (nonatomic, readonly) NSSet *changedObjects_cde; @property (nonatomic, readonly) NSDictionary *validationErrorsByManagedObjectURI_cde; @end @implementation NSManagedObjectContext (CDEValidationErrorsViewController) -- (NSSet *)changedObjects_cde { +- (NSSet *)changedObjects_cde { NSMutableSet *result = [NSMutableSet new]; [result unionSet:self.insertedObjects]; [result unionSet:self.updatedObjects]; [result unionSet:self.deletedObjects]; return result; } -- (NSDictionary *)validationErrorsByManagedObjectURI_cde { +- (NSDictionary*> *)validationErrorsByManagedObjectURI_cde { NSMutableDictionary *result = [NSMutableDictionary new]; NSSet *changedObjects = self.changedObjects_cde; for(NSManagedObject *object in changedObjects) { @@ -27,7 +27,7 @@ - (NSDictionary *)validationErrorsByManagedObjectURI_cde { } return result; } -- (NSArray *)validationErrorsByManagedObjectURIInArray_cde { +- (NSArray *)validationErrorsByManagedObjectURIInArray_cde { NSMutableArray *result = [NSMutableArray new]; NSDictionary *validationErrorsByManagedObjectURI = [self validationErrorsByManagedObjectURI_cde]; @@ -93,7 +93,6 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil - (void)loadView { [super loadView]; self.tableView.floatsGroupRows = NO; - //self.view.allowsVibrancy = YES; } #pragma mark - Private diff --git a/Core Data Editor/Core Data Editor/CDEValidationErrorsViewController.xib b/Core Data Editor/Core Data Editor/CDEValidationErrorsViewController.xib index 41f022b..48e7e63 100644 --- a/Core Data Editor/Core Data Editor/CDEValidationErrorsViewController.xib +++ b/Core Data Editor/Core Data Editor/CDEValidationErrorsViewController.xib @@ -33,7 +33,7 @@ - + @@ -140,7 +140,7 @@ - + diff --git a/Core Data Editor/Core Data Editor/Core Data Editor-Info.plist b/Core Data Editor/Core Data Editor/Core Data Editor-Info.plist index c10791b..0f8dff1 100644 --- a/Core Data Editor/Core Data Editor/Core Data Editor-Info.plist +++ b/Core Data Editor/Core Data Editor/Core Data Editor-Info.plist @@ -155,8 +155,8 @@ ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright Copyright © 2013 Christian Kienle. All rights reserved. - NSMainNibFile - MainMenu + NSMainStoryboardFile + Main NSPrincipalClass NSApplication diff --git a/Core Data Editor/Core Data Editor/Main.storyboard b/Core Data Editor/Core Data Editor/Main.storyboard new file mode 100644 index 0000000..f62a9c5 --- /dev/null +++ b/Core Data Editor/Core Data Editor/Main.storyboard @@ -0,0 +1,675 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core Data Editor/Core Data Editor/NSDirectoryEnumerator+ProjectBrowser.h b/Core Data Editor/Core Data Editor/NSDirectoryEnumerator+ProjectBrowser.h index bb9e434..952686d 100644 --- a/Core Data Editor/Core Data Editor/NSDirectoryEnumerator+ProjectBrowser.h +++ b/Core Data Editor/Core Data Editor/NSDirectoryEnumerator+ProjectBrowser.h @@ -2,7 +2,7 @@ @interface NSDirectoryEnumerator (ProjectBrowser) -- (void)getMetadataByStorePath:(NSDictionary **)metadataByStorePath modelByModelPath:(NSDictionary **)modelByModelPath; +- (void)getMetadataByStorePath:(NSDictionary **)metadataByStorePath modelByModelPath:(NSDictionary **)modelByModelPath; @end diff --git a/Core Data Editor/Core Data Editor/NSDirectoryEnumerator+ProjectBrowser.m b/Core Data Editor/Core Data Editor/NSDirectoryEnumerator+ProjectBrowser.m index 09bd22b..373aadd 100644 --- a/Core Data Editor/Core Data Editor/NSDirectoryEnumerator+ProjectBrowser.m +++ b/Core Data Editor/Core Data Editor/NSDirectoryEnumerator+ProjectBrowser.m @@ -3,104 +3,104 @@ @implementation NSURL (ProjectBrowser) -- (NSManagedObjectModel *)transformedManagedObjectModel { - BOOL isModel = [self isCompiledManagedObjectModelFile_cde]; - if(isModel == NO) { - return nil; +- (nullable NSManagedObjectModel *)transformedManagedObjectModel { + BOOL isModel = [self isCompiledManagedObjectModelFile_cde]; + if(isModel == NO) { + return nil; + } + + // try-catch because it is very well possible that a file seems to be a managed object model + // but it isn't or something else goes wrong when we initialize an NSManagedObjectModel with + // (unknown) contents of a file. + NSManagedObjectModel *transformedModel; + @try { + NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:self]; + if(model == nil) { + return nil; } - - // try-catch because it is very well possible that a file seems to be a managed object model - // but it isn't or something else goes wrong when we initialize an NSManagedObjectModel with - // (unknown) contents of a file. - NSManagedObjectModel *transformedModel; - @try { - NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:self]; - if(model == nil) { - return nil; - } - transformedModel = model.transformedManagedObjectModel_cde; - if(transformedModel == nil) { - return nil; - } - } - @catch (NSException *exception) { - + transformedModel = model.transformedManagedObjectModel_cde; + if(transformedModel == nil) { + return nil; } - @finally { - - } - return transformedModel; + } + @catch (NSException *exception) { + + } + @finally { + + } + return transformedModel; } -- (NSDictionary *)persistentStoreMetadata { - BOOL isData = [self isPublicDataFile_cde]; - if(isData == NO) { - return nil; - } +- (nullable NSDictionary *)persistentStoreMetadata { + BOOL isData = [self isPublicDataFile_cde]; + if(isData == NO) { + return nil; + } + + if([self isSQLiteURL_cde] == NO) { + return nil; + } + if([self isSQLiteStoreURL_cde] == NO) { + return nil; + } + NSDictionary *metadata; + @try { + NSError *error; + // +metadataForPersistentStoreOfType:URL:error: fails if we have a SQLite file but it is not a Core Data SQLite file... + metadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType URL:self options:nil error:&error]; - if([self isSQLiteURL_cde] == NO) { - return nil; - } - if([self isSQLiteStoreURL_cde] == NO) { - return nil; + if(metadata == nil) { + return nil; } - NSDictionary *metadata; - @try { - NSError *error; - // +metadataForPersistentStoreOfType:URL:error: fails if we have a SQLite file but it is not a Core Data SQLite file... - - metadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType URL:self options:nil error:&error]; - if(metadata == nil) { - return nil; - } - } - @catch (NSException *exception) { - - } - @finally { - - } - return metadata; + } + @catch (NSException *exception) { + + } + @finally { + + } + return metadata; } @end @implementation NSDirectoryEnumerator (ProjectBrowser) -- (void)getMetadataByStorePath:(NSDictionary **)outMetadataByStorePath modelByModelPath:(NSDictionary **)outModelByModelPath { - NSMutableDictionary *metadataByStorePath = [NSMutableDictionary new]; - NSMutableDictionary *modelByModelPath = [NSMutableDictionary new]; +- (void)getMetadataByStorePath:(NSDictionary **)outMetadataByStorePath modelByModelPath:(NSDictionary **)outModelByModelPath { + NSMutableDictionary *metadataByStorePath = [NSMutableDictionary new]; + NSMutableDictionary *modelByModelPath = [NSMutableDictionary new]; + + for(NSURL *URL in self) { + // Is URL a managed object model file? + NSManagedObjectModel *model = [URL transformedManagedObjectModel]; + if(model != nil) { // YES + modelByModelPath[URL.path] = model; + continue; + } - for(NSURL *URL in self) { - // Is URL a managed object model file? - NSManagedObjectModel *model = [URL transformedManagedObjectModel]; - if(model != nil) { // YES - modelByModelPath[URL.path] = model; - continue; - } - - BOOL isData = [URL isPublicDataFile_cde]; - if(isData == NO) { - continue; - } - - if([URL isSQLiteURL_cde] == NO) { - continue; - } - - NSDictionary *metadata = [URL persistentStoreMetadata]; - if(metadata == nil) { - continue; - } - metadataByStorePath[URL.path] = metadata; + BOOL isData = [URL isPublicDataFile_cde]; + if(isData == NO) { + continue; } - if(outMetadataByStorePath != NULL) { - *outMetadataByStorePath = metadataByStorePath; + if([URL isSQLiteURL_cde] == NO) { + continue; } - if(outModelByModelPath != NULL) { - *outModelByModelPath = modelByModelPath; + + NSDictionary *metadata = [URL persistentStoreMetadata]; + if(metadata == nil) { + continue; } + metadataByStorePath[URL.path] = metadata; + } + + if(outMetadataByStorePath != NULL) { + *outMetadataByStorePath = metadataByStorePath; + } + if(outModelByModelPath != NULL) { + *outModelByModelPath = modelByModelPath; + } } @end diff --git a/Core Data Editor/Core Data Editor/NSEntityDescription+CDEAdditions.h b/Core Data Editor/Core Data Editor/NSEntityDescription+CDEAdditions.h index 5db5b7e..bffaf6b 100644 --- a/Core Data Editor/Core Data Editor/NSEntityDescription+CDEAdditions.h +++ b/Core Data Editor/Core Data Editor/NSEntityDescription+CDEAdditions.h @@ -3,16 +3,16 @@ @interface NSEntityDescription (CDEAdditions) #pragma mark - Convenience -- (NSArray *)supportedAttributes_cde; -- (NSArray *)sortedToOneRelationships_cde; -- (NSArray *)sortedRelationships_cde; +- (NSArray *)supportedAttributes_cde; +- (NSArray *)sortedToOneRelationships_cde; +- (NSArray *)sortedRelationships_cde; @property (nonatomic, readonly) NSString *nameForDisplay_cde; #pragma mark - CSV // This method filters out any non supported property names and also respects the sorting of propertyNames -- (NSArray *)CSVValuesForEachManagedObjectInArray:(NSArray *)objects forPropertyNames:(NSArray *)propertyNames includeHeaderValues_cde:(BOOL)includeHeaderValues; -- (NSArray *)supportedCSVAttributes_cde; +- (NSArray*> *)CSVValuesForEachManagedObjectInArray:(NSArray *)objects forPropertyNames:(NSArray *)propertyNames includeHeaderValues_cde:(BOOL)includeHeaderValues; +- (NSArray *)supportedCSVAttributes_cde; #pragma mark - UI - (NSImage *)icon_cde; diff --git a/Core Data Editor/Core Data Editor/NSEntityDescription+CDEAdditions.m b/Core Data Editor/Core Data Editor/NSEntityDescription+CDEAdditions.m index 8566d50..08a3119 100644 --- a/Core Data Editor/Core Data Editor/NSEntityDescription+CDEAdditions.m +++ b/Core Data Editor/Core Data Editor/NSEntityDescription+CDEAdditions.m @@ -3,7 +3,7 @@ @implementation NSEntityDescription (CDEAdditions) #pragma mark - Convenience -- (NSArray *)supportedAttributes_cde { +- (NSArray *)supportedAttributes_cde { NSMutableArray *result = [NSMutableArray new]; for(NSAttributeDescription *attribute in [[self attributesByName] allValues]) { // Ignore transient properties @@ -20,7 +20,7 @@ - (NSArray *)supportedAttributes_cde { } -- (NSArray *)sortedToOneRelationships_cde { +- (NSArray *)sortedToOneRelationships_cde { NSMutableArray *result = [NSMutableArray new]; [self.relationshipsByName enumerateKeysAndObjectsUsingBlock:^(id key, NSRelationshipDescription *relation, BOOL *stop) { if(relation.isToMany) { @@ -33,7 +33,7 @@ - (NSArray *)sortedToOneRelationships_cde { }]; } -- (NSArray *)sortedRelationships_cde { +- (NSArray *)sortedRelationships_cde { return [self.relationshipsByName.allValues sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(NSRelationshipDescription *relationA, NSRelationshipDescription *relationB) { return [relationA.name localizedStandardCompare:relationB.name]; }]; @@ -46,7 +46,7 @@ - (NSString *)nameForDisplay_cde { #pragma mark - CSV // This method filters out any non supported property names and also respects the sorting of propertyNames -- (NSArray *)CSVValuesForEachManagedObjectInArray:(NSArray *)objects forPropertyNames:(NSArray *)propertyNames includeHeaderValues_cde:(BOOL)includeHeaderValues { +- (NSArray*> *)CSVValuesForEachManagedObjectInArray:(NSArray *)objects forPropertyNames:(NSArray *)propertyNames includeHeaderValues_cde:(BOOL)includeHeaderValues { NSParameterAssert(objects); NSParameterAssert(propertyNames); @@ -81,7 +81,7 @@ - (NSArray *)CSVValuesForEachManagedObjectInArray:(NSArray *)objects forProperty return result; } -- (NSArray *)supportedCSVAttributes_cde { +- (NSArray *)supportedCSVAttributes_cde { NSMutableArray *result = [NSMutableArray new]; for(NSAttributeDescription *attribute in self.supportedAttributes_cde) { if(attribute.isSupportedCSVAttribute_cde) { diff --git a/Core Data Editor/Core Data Editor/NSError+CDEValidation.h b/Core Data Editor/Core Data Editor/NSError+CDEValidation.h index 1502acc..1929d29 100644 --- a/Core Data Editor/Core Data Editor/NSError+CDEValidation.h +++ b/Core Data Editor/Core Data Editor/NSError+CDEValidation.h @@ -7,7 +7,7 @@ @property (nonatomic, readonly) NSAttributeDescription *invalidAttribute_cde; @property (nonatomic, readonly) NSManagedObject *invalidManagedObject_cde; @property (nonatomic, readonly) NSEntityDescription *entityDescription_cde; -@property (nonatomic, readonly) NSArray *detailedErrors_cde; +@property (nonatomic, readonly) NSArray *detailedErrors_cde; @property (nonatomic, readonly) BOOL containsDetailedErrors_cde; @end diff --git a/Core Data Editor/Core Data Editor/NSError+CDEValidation.m b/Core Data Editor/Core Data Editor/NSError+CDEValidation.m index f90f87d..fe1c150 100644 --- a/Core Data Editor/Core Data Editor/NSError+CDEValidation.m +++ b/Core Data Editor/Core Data Editor/NSError+CDEValidation.m @@ -62,7 +62,7 @@ - (NSManagedObject *)invalidManagedObject_cde { - (NSEntityDescription *)entityDescription_cde { return self.invalidManagedObject_cde.entity; } -- (NSArray *)detailedErrors_cde { +- (NSArray *)detailedErrors_cde { if(self.code != NSValidationMultipleErrorsError) { return @[]; } diff --git a/Core Data Editor/Core Data Editor/NSError-CDEAdditions.m b/Core Data Editor/Core Data Editor/NSError-CDEAdditions.m index 3d2a7a4..28b052c 100644 --- a/Core Data Editor/Core Data Editor/NSError-CDEAdditions.m +++ b/Core Data Editor/Core Data Editor/NSError-CDEAdditions.m @@ -1,7 +1,6 @@ #import "NSError-CDEAdditions.h" @implementation NSError (CDEAdditions) -//NSLocalizedRecoverySuggestionErrorKey = body, description = title #pragma mark Creating + (id)newErrorWithCode:(NSInteger)code localizedDescription:(NSString *)localizedDescription localizedRecoverySuggestion_cde:(NSString *)localizedRecoverySuggestion { NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; diff --git a/Core Data Editor/Core Data Editor/NSManagedObject+CDEAdditions.h b/Core Data Editor/Core Data Editor/NSManagedObject+CDEAdditions.h index 4b8a9a8..ea35fba 100644 --- a/Core Data Editor/Core Data Editor/NSManagedObject+CDEAdditions.h +++ b/Core Data Editor/Core Data Editor/NSManagedObject+CDEAdditions.h @@ -2,14 +2,14 @@ @interface NSManagedObject (CDEAdditions) -@property (nonatomic, readonly) NSArray *validationErrors_cde; +@property (nonatomic, readonly) NSArray *validationErrors_cde; #pragma mark - CSV // Special Consideration: attributeNames can contain @"objectID" although this is not an official attribute. // If it does then each objectID value is retrieved and added to the resulting array // as if it were a normal attribute. // This method does not do any further checks regarding attributeNames. -- (NSArray *)CSVValuesForAttributeNames_cde:(NSArray *)attributeNames; +- (NSArray *)CSVValuesForAttributeNames_cde:(NSArray *)attributeNames; #pragma mark - Creating + (instancetype)newManagedObjectWithEntity:(NSEntityDescription *)entity insertIntoManagedObjectContext:(NSManagedObjectContext *)context makeInsertedObjectValid_cde:(BOOL)makeInsertedObjectValid; diff --git a/Core Data Editor/Core Data Editor/NSManagedObject+CDEAdditions.m b/Core Data Editor/Core Data Editor/NSManagedObject+CDEAdditions.m index cffb801..6a51639 100644 --- a/Core Data Editor/Core Data Editor/NSManagedObject+CDEAdditions.m +++ b/Core Data Editor/Core Data Editor/NSManagedObject+CDEAdditions.m @@ -5,7 +5,7 @@ @implementation NSManagedObject (CDEAdditions) -- (NSArray *)validationErrors_cde { +- (NSArray *)validationErrors_cde { BOOL isValid = YES; NSError *error = nil; if(self.isInserted) { @@ -30,8 +30,8 @@ - (NSArray *)validationErrors_cde { } #pragma mark - CSV -- (NSArray *)CSVValuesForAttributeNames_cde:(NSArray *)attributeNames { - NSMutableArray *result = [NSMutableArray new]; +- (NSArray *)CSVValuesForAttributeNames_cde:(NSArray *)attributeNames { + NSMutableArray *result = [NSMutableArray new]; for(NSString *attributeName in attributeNames) { id value = [self valueForKey:attributeName]; if(value == nil) { diff --git a/Core Data Editor/Core Data Editor/NSManagedObjectModel-CDEAdditions.m b/Core Data Editor/Core Data Editor/NSManagedObjectModel-CDEAdditions.m index 5411d90..1d7cd86 100644 --- a/Core Data Editor/Core Data Editor/NSManagedObjectModel-CDEAdditions.m +++ b/Core Data Editor/Core Data Editor/NSManagedObjectModel-CDEAdditions.m @@ -12,31 +12,31 @@ @implementation CDEBinaryDataValueTransformer #pragma mark - Getting the Name + (NSString *)valueTransformerName { - return @"CDEBinaryDataValueTransformer"; + return @"CDEBinaryDataValueTransformer"; } #pragma mark - NSObject + (void)initialize { - if(self == [CDEBinaryDataValueTransformer class]) { - [NSValueTransformer setValueTransformer:[CDEBinaryDataValueTransformer new] forName:@"CDEBinaryDataValueTransformer"]; - } + if(self == [CDEBinaryDataValueTransformer class]) { + [NSValueTransformer setValueTransformer:[CDEBinaryDataValueTransformer new] forName:@"CDEBinaryDataValueTransformer"]; + } } #pragma mark - NSValueTransformer + (BOOL)allowsReverseTransformation { - return YES; + return YES; } + (Class)transformedValueClass { - return [NSData class]; + return [NSData class]; } - (id)transformedValue:(id)value { - return [NSData dataWithData:value]; + return [NSData dataWithData:value]; } - (id)reverseTransformedValue:(id)value { - return [NSData dataWithData:value]; + return [NSData dataWithData:value]; } @end @@ -45,100 +45,101 @@ @implementation NSManagedObjectModel (CDEAdditions) #pragma mark - Creating + (BOOL)canInitWithContentsOfURL:(NSURL *)URL error_cde:(NSError **)error { - if(URL == nil) { - NSLog(@"WARNING: Called '%@' with a nil URL.", NSStringFromSelector(_cmd)); - return NO; - } - - @try { - NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:URL]; - if(model != nil) { - // More Analysis: Find relations with no inverse - for(NSEntityDescription *entity in model) { - for(NSRelationshipDescription *relation in [[entity relationshipsByName] allValues]) { - if(relation.inverseRelationship == nil) { - if(error != NULL) { - NSString *description = [NSString stringWithFormat:@"The model %@ cannot be handled", URL.lastPathComponent]; - NSString *reason = [NSString stringWithFormat:@"Your model has at least one relationship (%@) without an inverse. This is not supported.", relation.name]; - *error = [NSError newErrorWithCode:-1 localizedDescription:description localizedRecoverySuggestion_cde:reason]; - } - - return NO; - } - } + if(URL == nil) { + NSLog(@"WARNING: Called '%@' with a nil URL.", NSStringFromSelector(_cmd)); + return NO; + } + + @try { + NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:URL]; + if(model != nil) { + // More Analysis: Find relations with no inverse + for(NSEntityDescription *entity in model) { + for(NSRelationshipDescription *relation in [[entity relationshipsByName] allValues]) { + if(relation.inverseRelationship == nil) { + if(error != NULL) { + NSString *description = [NSString stringWithFormat:@"The model %@ cannot be handled", URL.lastPathComponent]; + NSString *reason = [NSString stringWithFormat:@"Your model has at least one relationship (%@) without an inverse. This is not supported.", relation.name]; + *error = [NSError newErrorWithCode:-1 localizedDescription:description localizedRecoverySuggestion_cde:reason]; } - return YES; + + return NO; + } } + } + return YES; } - @catch (NSException *exception) { - if(error != NULL) { - NSString *description = [NSString stringWithFormat:@"The model %@ cannot be handled", URL.lastPathComponent]; - NSString *reason = [NSString stringWithFormat:@"Opening the model raised an exception: %@", exception.name]; - *error = [NSError newErrorWithCode:-1 localizedDescription:description localizedRecoverySuggestion_cde:reason]; - } - return NO; + } + @catch (NSException *exception) { + if(error != NULL) { + NSString *description = [NSString stringWithFormat:@"The model %@ cannot be handled", URL.lastPathComponent]; + NSString *reason = [NSString stringWithFormat:@"Opening the model raised an exception: %@", exception.name]; + *error = [NSError newErrorWithCode:-1 localizedDescription:description localizedRecoverySuggestion_cde:reason]; } - return NO; + } + + return NO; } #pragma mark - Transforming - (NSManagedObjectModel *)transformedManagedObjectModel_cde { - NSData *originalModelData = [NSKeyedArchiver archivedDataWithRootObject:self]; - NSManagedObjectModel *transformedModel = [NSKeyedUnarchiver unarchiveObjectWithData:originalModelData]; - - // Remove custom Value Transformers - for(NSEntityDescription *entityDescription in transformedModel) { - NSArray *attributes = [[entityDescription attributesByName] allValues]; - for(NSAttributeDescription *attributeDescription in attributes) { - if(attributeDescription.attributeType != NSTransformableAttributeType) { - continue; - } - NSString *transformerName = attributeDescription.valueTransformerName; - if([[NSValueTransformer valueTransformerNames] containsObject:transformerName] == YES) { - continue; - } - attributeDescription.valueTransformerName = [CDEBinaryDataValueTransformer valueTransformerName]; - } - } - - NSMutableDictionary *localizationDictionary = [NSMutableDictionary dictionary]; - for(NSEntityDescription *entityDescription in transformedModel) { - NSDictionary *propertiesByName = entityDescription.propertiesByName; - [propertiesByName enumerateKeysAndObjectsUsingBlock:^(NSString *propertyName, NSPropertyDescription *propertyDescription, BOOL *stop) { - NSString *name = propertyName; - NSString *entityName = entityDescription.name; - NSString *localizedEntryKey = [NSString stringWithFormat:@"//Property/%@/Entity/%@", name, entityName]; - NSString *localizedEntryValue = name; - if(localizedEntryKey != nil) { - localizationDictionary[localizedEntryKey] = localizedEntryValue; - } - }]; + NSData *originalModelData = [NSKeyedArchiver archivedDataWithRootObject:self]; + NSManagedObjectModel *transformedModel = [NSKeyedUnarchiver unarchiveObjectWithData:originalModelData]; + + // Remove custom Value Transformers + for(NSEntityDescription *entityDescription in transformedModel) { + NSArray *attributes = [[entityDescription attributesByName] allValues]; + for(NSAttributeDescription *attributeDescription in attributes) { + if(attributeDescription.attributeType != NSTransformableAttributeType) { + continue; + } + NSString *transformerName = attributeDescription.valueTransformerName; + if([[NSValueTransformer valueTransformerNames] containsObject:transformerName] == YES) { + continue; + } + attributeDescription.valueTransformerName = [CDEBinaryDataValueTransformer valueTransformerName]; } - transformedModel.localizationDictionary = localizationDictionary; - return transformedModel; + } + + NSMutableDictionary *localizationDictionary = [NSMutableDictionary dictionary]; + for(NSEntityDescription *entityDescription in transformedModel) { + NSDictionary *propertiesByName = entityDescription.propertiesByName; + [propertiesByName enumerateKeysAndObjectsUsingBlock:^(NSString *propertyName, NSPropertyDescription *propertyDescription, BOOL *stop) { + NSString *name = propertyName; + NSString *entityName = entityDescription.name; + NSString *localizedEntryKey = [NSString stringWithFormat:@"//Property/%@/Entity/%@", name, entityName]; + NSString *localizedEntryValue = name; + if(localizedEntryKey != nil) { + localizationDictionary[localizedEntryKey] = localizedEntryValue; + } + }]; + } + transformedModel.localizationDictionary = localizationDictionary; + return transformedModel; } #pragma mark - Compatibility - (BOOL)isCompatibleWithStoreAtURL:(NSURL *)URL error_cde:(NSError **)error { - NSParameterAssert(URL); - NSError *metadataError = nil; + NSParameterAssert(URL); + NSError *metadataError = nil; + NSDictionary *metadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType URL:URL options:nil error:&metadataError]; - if(metadata == nil) { - if(error != NULL) { - *error = metadataError; - } - NSLog(@"Failed to determine metadata: %@", metadataError); - return NO; + if(metadata == nil) { + if(error != NULL) { + *error = metadataError; } - - BOOL isCompatible = [self isConfiguration:nil compatibleWithStoreMetadata:metadata]; - if(isCompatible == NO) { - if(error != NULL) { - *error = [NSError newErrorWithCode:-1 localizedDescription:@"Store is incompatible with Model" localizedRecoverySuggestion_cde:@"Make sure that the store file was generated by using the correct version of your model."]; - } + NSLog(@"Failed to determine metadata: %@", metadataError); + return NO; + } + + BOOL isCompatible = [self isConfiguration:nil compatibleWithStoreMetadata:metadata]; + if(isCompatible == NO) { + if(error != NULL) { + *error = [NSError newErrorWithCode:-1 localizedDescription:@"Store is incompatible with Model" localizedRecoverySuggestion_cde:@"Make sure that the store file was generated by using the correct version of your model."]; } - return isCompatible; + } + return isCompatible; } @end diff --git a/Core Data Editor/Core Data Editor/NSPasteboard-CDEAdditions.h b/Core Data Editor/Core Data Editor/NSPasteboard-CDEAdditions.h index 6a6a524..d49bbba 100644 --- a/Core Data Editor/Core Data Editor/NSPasteboard-CDEAdditions.h +++ b/Core Data Editor/Core Data Editor/NSPasteboard-CDEAdditions.h @@ -3,7 +3,7 @@ @interface NSPasteboard (CDEAdditions) #pragma mark Getting URLs from the Pasteboard -- (NSArray *)cde_URLs; +- (NSArray *)cde_URLs; - (NSURL *)cde_URL; @end diff --git a/Core Data Editor/Core Data Editor/NSPasteboard-CDEAdditions.m b/Core Data Editor/Core Data Editor/NSPasteboard-CDEAdditions.m index 2a61b08..bdbc289 100644 --- a/Core Data Editor/Core Data Editor/NSPasteboard-CDEAdditions.m +++ b/Core Data Editor/Core Data Editor/NSPasteboard-CDEAdditions.m @@ -3,7 +3,7 @@ @implementation NSPasteboard (CDEAdditions) #pragma mark Getting URLs from the Pasteboard -- (NSArray *)cde_URLs { +- (NSArray *)cde_URLs { NSArray *classes = @[[NSURL class]]; NSDictionary *options = @{NSPasteboardURLReadingFileURLsOnlyKey: @YES}; NSArray *fileURLs = [self readObjectsForClasses:classes options:options]; diff --git a/Core Data Editor/Core Data Editor/NSPersistentStore+CDEStoreAnalyzer.m b/Core Data Editor/Core Data Editor/NSPersistentStore+CDEStoreAnalyzer.m index 90ee1ae..632f517 100644 --- a/Core Data Editor/Core Data Editor/NSPersistentStore+CDEStoreAnalyzer.m +++ b/Core Data Editor/Core Data Editor/NSPersistentStore+CDEStoreAnalyzer.m @@ -4,10 +4,10 @@ @implementation NSPersistentStore (CDEStoreAnalyzer) #pragma mark - Getting the Type of a Store // Returns nil if no store type could be determined -+ (NSString *)typeOfPersistentStoreAtURL_cde:(NSURL *)URL { ++ (NSString *)typeOfPersistentStoreAtURL_cde:(NSURL *)storeURL { NSError *error = nil; @try { - NSDictionary *metadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType URL:URL options:nil error:&error]; + NSDictionary *metadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType URL:storeURL options:nil error:&error]; if(metadata == nil) { NSLog(@"Failed to determine store metadata: %@", error); diff --git a/Core Data Editor/Core Data Editor/NSURL+CDEAdditions.m b/Core Data Editor/Core Data Editor/NSURL+CDEAdditions.m index 0c7252b..9b364be 100644 --- a/Core Data Editor/Core Data Editor/NSURL+CDEAdditions.m +++ b/Core Data Editor/Core Data Editor/NSURL+CDEAdditions.m @@ -117,4 +117,4 @@ - (BOOL)isSQLiteStoreURL_cde { return primaryKeyTableFound; } -@end \ No newline at end of file +@end diff --git a/Core Data Editor/Core Data Editor/Preferences.storyboard b/Core Data Editor/Core Data Editor/Preferences.storyboard new file mode 100644 index 0000000..6e8a490 --- /dev/null +++ b/Core Data Editor/Core Data Editor/Preferences.storyboard @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core Data Editor/Core Data Editor/PreferencesFormatting.storyboard b/Core Data Editor/Core Data Editor/PreferencesFormatting.storyboard new file mode 100644 index 0000000..70de254 --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesFormatting.storyboard @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core Data Editor/Core Data Editor/PreferencesFormattingVC.h b/Core Data Editor/Core Data Editor/PreferencesFormattingVC.h new file mode 100644 index 0000000..e1cc754 --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesFormattingVC.h @@ -0,0 +1,5 @@ +#import + +@interface PreferencesFormattingVC : NSViewController + +@end diff --git a/Core Data Editor/Core Data Editor/PreferencesFormattingVC.m b/Core Data Editor/Core Data Editor/PreferencesFormattingVC.m new file mode 100644 index 0000000..608646f --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesFormattingVC.m @@ -0,0 +1,19 @@ +#import "PreferencesFormattingVC.h" + +@interface PreferencesFormattingVC () + +@end + +@implementation PreferencesFormattingVC + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Initialization code here. + } + + return self; +} + +@end diff --git a/Core Data Editor/Core Data Editor/PreferencesGeneral.storyboard b/Core Data Editor/Core Data Editor/PreferencesGeneral.storyboard new file mode 100644 index 0000000..ed5ecff --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesGeneral.storyboard @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.h b/Core Data Editor/Core Data Editor/PreferencesGeneralVC.h similarity index 75% rename from Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.h rename to Core Data Editor/Core Data Editor/PreferencesGeneralVC.h index 3088909..1f6260d 100644 --- a/Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.h +++ b/Core Data Editor/Core Data Editor/PreferencesGeneralVC.h @@ -8,6 +8,6 @@ #import -@interface CDEPreferencesMiscViewController : NSViewController +@interface PreferencesGeneralVC : NSViewController @end diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.m b/Core Data Editor/Core Data Editor/PreferencesGeneralVC.m similarity index 74% rename from Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.m rename to Core Data Editor/Core Data Editor/PreferencesGeneralVC.m index 8f3853f..1d06810 100644 --- a/Core Data Editor/Core Data Editor/CDEPreferencesMiscViewController.m +++ b/Core Data Editor/Core Data Editor/PreferencesGeneralVC.m @@ -6,13 +6,13 @@ // Copyright (c) 2013 Christian Kienle. All rights reserved. // -#import "CDEPreferencesMiscViewController.h" +#import "PreferencesGeneralVC.h" -@interface CDEPreferencesMiscViewController () +@interface PreferencesGeneralVC () @end -@implementation CDEPreferencesMiscViewController +@implementation PreferencesGeneralVC - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { diff --git a/Core Data Editor/Core Data Editor/PreferencesIntegration.storyboard b/Core Data Editor/Core Data Editor/PreferencesIntegration.storyboard new file mode 100644 index 0000000..1793985 --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesIntegration.storyboard @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + If you tell Core Data Editor where your derived data directory is you can then drop store files on the dock icon and Core Data Editor will automatically try to find a matching model by looking at every model (recursively) in your derived data directory. The derived data directory is usually located at ~/Library/Developer/Xcode/DerivedData. + + + + + + + + + + Please specify your iPhone Simulator directory. This directory is usually located in ~/Library/Application Support/iPhone Simulator/. Specifying your iPhone Simulator directory enables the project browser feature. The project browser automatically finds compatible SQLite stores and managed object models and let's you quickly create a Core Data Editor projects. You access the project browser from the "Window | Project Browser" menu item. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core Data Editor/Core Data Editor/PreferencesIntegrationVC.h b/Core Data Editor/Core Data Editor/PreferencesIntegrationVC.h new file mode 100644 index 0000000..e408bf4 --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesIntegrationVC.h @@ -0,0 +1,7 @@ +#import + +@interface PreferencesIntegrationVC : NSViewController + +- (void)displayInfoSheet; + +@end diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.m b/Core Data Editor/Core Data Editor/PreferencesIntegrationVC.m similarity index 94% rename from Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.m rename to Core Data Editor/Core Data Editor/PreferencesIntegrationVC.m index 5cfd3ca..0cc7ae1 100644 --- a/Core Data Editor/Core Data Editor/CDEPreferencesAutomaticProjectCreationViewController.m +++ b/Core Data Editor/Core Data Editor/PreferencesIntegrationVC.m @@ -1,8 +1,8 @@ -#import "CDEPreferencesAutomaticProjectCreationViewController.h" +#import "PreferencesIntegrationVC.h" #import "NSURL+CDEAdditions.h" #import "CDEPathPickerPopUpButton.h" -@interface CDEPreferencesAutomaticProjectCreationViewController () +@interface PreferencesIntegrationVC () #pragma mark - Properties @property (nonatomic, weak) IBOutlet CDEPathPickerPopUpButton *buildDirectoryPopUpButton; @@ -10,7 +10,7 @@ @interface CDEPreferencesAutomaticProjectCreationViewController () @end -@implementation CDEPreferencesAutomaticProjectCreationViewController +@implementation PreferencesIntegrationVC - (void)loadView { [super loadView]; diff --git a/Core Data Editor/Core Data Editor/PreferencesVC.h b/Core Data Editor/Core Data Editor/PreferencesVC.h new file mode 100644 index 0000000..d54b1c9 --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesVC.h @@ -0,0 +1,4 @@ +#import + +@interface PreferencesVC : NSTabViewController +@end diff --git a/Core Data Editor/Core Data Editor/PreferencesVC.m b/Core Data Editor/Core Data Editor/PreferencesVC.m new file mode 100644 index 0000000..cb99fb1 --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesVC.m @@ -0,0 +1,4 @@ +#import "PreferencesVC.h" + +@implementation PreferencesVC +@end diff --git a/Core Data Editor/Core Data Editor/CDEPreferencesWindowController.h b/Core Data Editor/Core Data Editor/PreferencesWC.h similarity index 80% rename from Core Data Editor/Core Data Editor/CDEPreferencesWindowController.h rename to Core Data Editor/Core Data Editor/PreferencesWC.h index 7debcd4..86e77e8 100644 --- a/Core Data Editor/Core Data Editor/CDEPreferencesWindowController.h +++ b/Core Data Editor/Core Data Editor/PreferencesWC.h @@ -1,12 +1,8 @@ #import - typedef void(^CDEPreferencesWindowControllerCompletionHandler)(void); -@interface CDEPreferencesWindowController : NSWindowController - -#pragma mark - Showing the Preferences Window +@interface PreferencesWC : NSWindowController - (void)showWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler; - (void)showAutomaticProjectCreationPreferencesAndDisplayInfoSheetWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler; - (void)showAutomaticProjectCreationPreferencesWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler; - @end diff --git a/Core Data Editor/Core Data Editor/PreferencesWC.m b/Core Data Editor/Core Data Editor/PreferencesWC.m new file mode 100644 index 0000000..5a4a1fc --- /dev/null +++ b/Core Data Editor/Core Data Editor/PreferencesWC.m @@ -0,0 +1,45 @@ +#import "PreferencesWC.h" + +@interface PreferencesWC () + +@end + +@implementation PreferencesWC + +- (void)windowDidLoad { + [super windowDidLoad]; + + // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. +} + +#pragma mark - Showing the Preferences Window +- (void)showWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler { +// self.completionHandler = handler; +// [self showWindow:self]; +} + +- (void)showAutomaticProjectCreationPreferencesAndDisplayInfoSheetWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler { + assert(false); + +// [self showAutomaticProjectCreationPreferencesWithCompletionHandler:handler]; +// double delayInSeconds = 0.5; +// dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); +// dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ +// NSString *identifier = NSStringFromClass([CDEPreferencesAutomaticProjectCreationViewController class]); +// CDEPreferencesAutomaticProjectCreationViewController *viewController = (CDEPreferencesAutomaticProjectCreationViewController *)[self existingViewControllerForToolbarItemWithIdentifier:identifier]; +// [viewController displayInfoSheet]; +// }); +} + +- (void)showAutomaticProjectCreationPreferencesWithCompletionHandler:(CDEPreferencesWindowControllerCompletionHandler)handler { + assert(false); + +// self.completionHandler = handler; +// [self showWindow:self]; +// NSString *identifier = NSStringFromClass([CDEPreferencesAutomaticProjectCreationViewController class]); +// CDEPreferencesAutomaticProjectCreationViewController *viewController = (CDEPreferencesAutomaticProjectCreationViewController *)[self existingViewControllerForToolbarItemWithIdentifier:identifier]; +// [self showViewController:viewController]; +} + + +@end diff --git a/Core Data Editor/Core Data Editor/VibrantView.h b/Core Data Editor/Core Data Editor/VibrantView.h deleted file mode 100644 index 3bb4a61..0000000 --- a/Core Data Editor/Core Data Editor/VibrantView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// VibrantView.h -// Core Data Editor -// -// Created by cmk on 02/10/14. -// Copyright (c) 2014 Christian Kienle. All rights reserved. -// - -#import - -@interface VibrantView : NSView - -@end diff --git a/Core Data Editor/Core Data Editor/VibrantView.m b/Core Data Editor/Core Data Editor/VibrantView.m deleted file mode 100644 index f13c5c7..0000000 --- a/Core Data Editor/Core Data Editor/VibrantView.m +++ /dev/null @@ -1,21 +0,0 @@ -// -// VibrantView.m -// Core Data Editor -// -// Created by cmk on 02/10/14. -// Copyright (c) 2014 Christian Kienle. All rights reserved. -// - -#import "VibrantView.h" - -@implementation VibrantView - -- (void)drawRect:(NSRect)dirtyRect { - [super drawRect:dirtyRect]; - - // Drawing code here. -} - -- (BOOL)allowsVibrancy { return YES; } - -@end diff --git a/Core Data Editor/Core Data Editor/en.lproj/CDEDocument.xib b/Core Data Editor/Core Data Editor/en.lproj/CDEDocument.xib index 3a7362a..f50cc0a 100644 --- a/Core Data Editor/Core Data Editor/en.lproj/CDEDocument.xib +++ b/Core Data Editor/Core Data Editor/en.lproj/CDEDocument.xib @@ -1,588 +1,63 @@ - - - 101000 - 14A379a - 6249 - 1343.13 - 755.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 6249 - - - NSCustomObject - NSCustomView - NSToolbar - NSToolbarFlexibleSpaceItem - NSToolbarItem - NSToolbarSpaceItem - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - CDEDocument - - - FirstResponder - - - 15 - 2 - {{133, 235}, {562, 458}} - 1886912512 - Window - NSWindow - - - 56A4D294-07E7-4E39-AF1E-36FEE88351FC - - - YES - YES - NO - NO - 1 - 2 - - - - 44533143-C9D0-4AA1-B7F0-54EEB1F8BB44 - - Generate Code - Generate Code - - - - NSImage - code-icon - - - - {0, 0} - {0, 0} - YES - YES - 2 - YES - 0 - - - - 7C37B1DE-B96E-4A4A-8CC4-B0083C9FEA2E - - Configuration - Configuration - - - - NSImage - NSAdvanced - - - - {0, 0} - {0, 0} - YES - YES - -1 - YES - 0 - - - - EAA2489A-5079-468A-B1FE-58ABC60F23C2 - - CSV Import - CSV Import - - - - NSImage - csv-icon - - - - {0, 0} - {0, 0} - YES - YES - 1 - YES - 0 - - - NSToolbarFlexibleSpaceItem - - Flexible Space - - - - - - {1, 5} - {20000, 32} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - - - - NSToolbarSpaceItem - - Space - - - - - - {32, 5} - {32, 10000} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - - - - - - - - - - - - - - - - - - - - {500, 300} - - - 256 - - - - 274 - {562, 458} - - - - _NS:9 - NSView - - - {562, 458} - - - - - {{0, 0}, {1280, 777}} - {500, 378} - {10000000000000, 10000000000000} - YES - - - NSApplication - - - - - - - window - - - - 18 - - - - showConfiguration: - - - - 100034 - - - - containerView - - - - 100042 - - - - showImportCSVFileWindow: - - - - 100053 - - - - generateCode: - - - - 100055 - - - - delegate - - - - 17 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - 5 - - - - - - - Window - - - 6 - - - - - - - - -3 - - - Application - - - 100027 - - - - - - - - - - - - 100028 - - - - - 100031 - - - - - 100033 - - - - - 100035 - - - - - 100052 - - - - - 100054 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - CDECSV - com.apple.InterfaceBuilder.CocoaPlugin - CDECode - - - {277, 336} - com.apple.InterfaceBuilder.CocoaPlugin - {{133, 170}, {507, 413}} - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 100059 - - - - - CDEDocument - NSPersistentDocument - - IBProjectSource - Core Data Editor/Core Data Editor/CDEDocument.h - - - - CDEDocument - - id - id - id - id - id - id - id - - - - copySelectedObjectsAsCSV: - id - - - deleteSelectedObjcts: - id - - - generateCode: - id - - - insertObject: - id - - - showConfiguration: - id - - - showImportCSVFileWindow: - id - - - takeQueryFromSender: - id - - - - containerView - NSView - - - containerView - - containerView - NSView - - - - IBProjectSource - Core Data Editor/Core Data Editor/CDEDocument.m - - - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSDocument - NSObject - - id - id - id - id - id - id - - - - printDocument: - id - - - revertDocumentToSaved: - id - - - runPageLayout: - id - - - saveDocument: - id - - - saveDocumentAs: - id - - - saveDocumentTo: - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSDocument.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSPersistentDocument - NSDocument - - IBFrameworkSource - AppKit.framework/Headers/NSPersistentDocument.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSToolbar - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbar.h - - - - NSToolbarItem - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSView - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - - 0 - IBCocoaFramework - NO - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - {32, 32} - {12, 12} - {10, 2} - {39, 39} - {39, 39} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core Data Editor/Core Data Editor/mogenerator/mogenerator b/Core Data Editor/Core Data Editor/mogenerator/mogenerator deleted file mode 100755 index a846844..0000000 Binary files a/Core Data Editor/Core Data Editor/mogenerator/mogenerator and /dev/null differ diff --git a/Core Data Editor/Core Data Editor/mogenerator/mogeneratorReadme.rtf b/Core Data Editor/Core Data Editor/mogenerator/mogeneratorReadme.rtf deleted file mode 100644 index 5196265..0000000 --- a/Core Data Editor/Core Data Editor/mogenerator/mogeneratorReadme.rtf +++ /dev/null @@ -1,11 +0,0 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 -{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} -{\colortbl;\red255\green255\blue255;\red78\green78\blue78;\red246\green247\blue254;} -\paperw11900\paperh16840\margl1440\margr1440\vieww11900\viewh13760\viewkind1 -\deftab720 -\pard\pardeftab720\sl320\sa260\ql\qnatural - -\f0\fs24 \cf2 \cb3 The classes for your model are located in the directory "Human" and "Machine". These files were generated by "{\field{\*\fldinst{HYPERLINK "https://github.com/rentzsch/mogenerator"}}{\fldrslt mogenerator}}".\ -"{\field{\*\fldinst{HYPERLINK "https://github.com/rentzsch/mogenerator"}}{\fldrslt mogenerator}} is a command-line tool that, given an .xcdatamodel file, will generate two classes per entity. The first class, _MyEntity, is intended solely for machine consumption and will be continuously overwritten to stay in sync with your data model. The second class, MyEntity, subclasses _MyEntity, won't ever be overwritten and is a great place to put your custom logic."\ -If you would like to learn more about {\field{\*\fldinst{HYPERLINK "https://github.com/rentzsch/mogenerator"}}{\fldrslt mogenerator}} visit the {\field{\*\fldinst{HYPERLINK "https://github.com/rentzsch/mogenerator"}}{\fldrslt project page}} on {\field{\*\fldinst{HYPERLINK "https://github.com"}}{\fldrslt github.com}}.\ -} \ No newline at end of file diff --git a/Core Data Editor/Core Data Editor/mogenerator/unsigned/mogenerator b/Core Data Editor/Core Data Editor/mogenerator/unsigned/mogenerator deleted file mode 100755 index 05daa63..0000000 Binary files a/Core Data Editor/Core Data Editor/mogenerator/unsigned/mogenerator and /dev/null differ diff --git a/Core Data Editor/Graphics/App.sketch/metadata b/Core Data Editor/Graphics/App.sketch/metadata new file mode 100644 index 0000000..e504c45 --- /dev/null +++ b/Core Data Editor/Graphics/App.sketch/metadata @@ -0,0 +1,28 @@ + + + + + app + com.bohemiancoding.sketch + build + 5355 + commit + b7d299b0a34651d1a0e066786b75aa36168d5809 + fonts + + Helvetica + Helvetica + Helvetica + Menlo-Regular + Helvetica + Helvetica + Helvetica + Helvetica + Helvetica + + length + 95243 + version + 18 + + diff --git a/Core Data Editor/Untitled-1.fw.png b/Core Data Editor/Untitled-1.fw.png deleted file mode 100644 index 39f9524..0000000 Binary files a/Core Data Editor/Untitled-1.fw.png and /dev/null differ diff --git a/README.md b/README.md index 0825017..cbc2fde 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -Flattr this - # Build Status | Branch | Status | | ------------- |:-------------:| @@ -7,18 +5,17 @@ | Develop | [![Build Status](https://travis-ci.org/ChristianKienle/Core-Data-Editor.svg?branch=develop)](https://travis-ci.org/ChristianKienle/Core-Data-Editor) | # Core Data Editor -Core Data Editor Logo + +Core Data Editor Logo Core Data Editor lets you easily view, edit and analyze applications‘ data. Core Data Editor is compatible with Mac and iOS applications and supports XML, SQLite and binary stores, visualizes all relationships and is able to edit the data and generate Objective-C code for the data model. Core Data Editor will guide you through a short setup process when you initially launch the app. This setup process is entirely optional. You can skip over each and every step if you know what you are doing. It is recommended that you take your time and go though the setup process. It only takes a few minutes. -![](http://thermal-core.com/img/cde/screenshot_main_cut.png) +![](screenshot.png) # Donations -If you want to support Core Data Editor you can donate via PayPal to me@christian-kienle.de. You can also flattr Core Data Editor: - -Flattr this +If you want to support Core Data Editor you can [donate via PayPal](https://www.paypal.me/christiankienle). Thanks. @@ -59,8 +56,9 @@ A data coordinator is represented by an instance of `CDERequestDataCoordinator` That being said there should be little reason to introduce a new coordinator subclass. + # Contributing -Without you, Core Data Editor will probably die soon. If you want to contribute send me pull requests. Have a look at the issue tracker to find out what should be done next. +If you want to contribute send me pull requests. Have a look at the issue tracker to find out what should be done next. # Credits Core Data Editor has the following third party dependencies: @@ -78,9 +76,8 @@ Core Data Editor has the following third party dependencies: * [danydev](https://github.com/danydev) * [Roberto Dries](https://github.com/robertodries92) * [Mitch Cohen](https://github.com/mitchcohen) - # Contact -[Christian Kienle (me@christian-kienle.de)](mailto:me@christian-kienle.de) +[Christian Kienle (kienle.christian@icloud.com)](mailto:kienle.christian@icloud.com) # License 3-clause BSD (please don't sue me) diff --git a/app-icon.png b/app-icon.png new file mode 100644 index 0000000..cc087ea Binary files /dev/null and b/app-icon.png differ diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..b8cff58 Binary files /dev/null and b/screenshot.png differ