Skip to content
Browse files

removed unneeded synthesize

  • Loading branch information...
1 parent 7d34f2b commit 12d56c71c372ba68f830073c8b7c6413c81103ce Chris Wilson committed
View
BIN ...xcodeproj/project.xcworkspace/xcuserdata/chris.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
10 ...l.xcodeproj/project.xcworkspace/xcuserdata/chris.xcuserdatad/WorkspaceSettings.xcsettings
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
+ <true/>
+ <key>SnapshotAutomaticallyBeforeSignificantChanges</key>
+ <false/>
+</dict>
+</plist>
View
96 CoreDataUtil.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/CoreDataUtil.xcscheme
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0450"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C1CEFE501463779C00466EB3"
+ BuildableName = "CoreDataPro.app"
+ BlueprintName = "CoreDataUtil"
+ ReferencedContainer = "container:CoreDataUtil.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C1CEFE741463779D00466EB3"
+ BuildableName = "CoreDataUtilTests.octest"
+ BlueprintName = "CoreDataUtilTests"
+ ReferencedContainer = "container:CoreDataUtil.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C1CEFE501463779C00466EB3"
+ BuildableName = "CoreDataPro.app"
+ BlueprintName = "CoreDataUtil"
+ ReferencedContainer = "container:CoreDataUtil.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C1CEFE501463779C00466EB3"
+ BuildableName = "CoreDataPro.app"
+ BlueprintName = "CoreDataUtil"
+ ReferencedContainer = "container:CoreDataUtil.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C1CEFE501463779C00466EB3"
+ BuildableName = "CoreDataPro.app"
+ BlueprintName = "CoreDataUtil"
+ ReferencedContainer = "container:CoreDataUtil.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
View
59 CoreDataUtil.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/CoreDataUtilImporter.xcscheme
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0450"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C1CEFE871463779D00466EB3"
+ BuildableName = "CoreDataUtilImporter.mdimporter"
+ BlueprintName = "CoreDataUtilImporter"
+ ReferencedContainer = "container:CoreDataUtil.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
View
37 CoreDataUtil.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>CoreDataUtil.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ <key>CoreDataUtilImporter.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>C1CEFE501463779C00466EB3</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ <key>C1CEFE741463779D00466EB3</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ <key>C1CEFE871463779D00466EB3</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
View
8 CoreDataUtil/CoreData/MFLCoreDataCommon.m
@@ -9,10 +9,6 @@
#import "MFLCoreDataCommon.h"
@implementation MFLCoreDataCommon
-@synthesize managedObjectModel = _managedObjectModel;
-@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;
-@synthesize context = _context;
-@synthesize managedObjectContext = _managedObjectContext;
/**
Creates if necessary and returns the managed object model for the application.
@@ -50,7 +46,7 @@ - (NSPersistentStoreCoordinator *) persistentStoreCoordinator
NSURL *applicationFilesDirectory = [self applicationFilesDirectory];
NSError *error = nil;
- NSDictionary *properties = [applicationFilesDirectory resourceValuesForKeys:[NSArray arrayWithObject:NSURLIsDirectoryKey] error:&error];
+ NSDictionary *properties = [applicationFilesDirectory resourceValuesForKeys:@[NSURLIsDirectoryKey] error:&error];
if (!properties)
{
BOOL ok = NO;
@@ -66,7 +62,7 @@ - (NSPersistentStoreCoordinator *) persistentStoreCoordinator
}
else
{
- if ([[properties objectForKey:NSURLIsDirectoryKey] boolValue] != YES)
+ if ([properties[NSURLIsDirectoryKey] boolValue] != YES)
{
// Customize and localize this error.
NSString *failureDescription = [NSString stringWithFormat:@"Expected a folder to store application data, found a file (%@).", [applicationFilesDirectory path]];
View
33 CoreDataUtil/CoreData/MFLCoreDataIntrospection.m
@@ -22,19 +22,6 @@ - (NSError *)errnoErrorWithReason:(NSString *)reason;
@implementation MFLCoreDataIntrospection
-@synthesize delegate = _delegate;
-
-@synthesize storeType = _storeType;
-@synthesize objModel = _objModel;
-@synthesize momFileUrl = _momFileUrl;
-@synthesize dbFileUrl = _dbFileUrl;
-
-@synthesize entities = _entities;
-@synthesize entityData = _entityData;
-
-@synthesize dateStyle = _dateStyle;
-@synthesize coreDataHistory = _coreDataHistory;
-
- (id)init
{
self = [super init];
@@ -146,7 +133,7 @@ - (void) reloadObjectModel {
}
- (NSEntityDescription*) entityDescription:(NSUInteger) index {
- NSEntityDescription* entityDescription = [[self.objModel entities] objectAtIndex:index];
+ NSEntityDescription* entityDescription = [self.objModel entities][index];
return entityDescription;
}
@@ -237,7 +224,7 @@ - (void)sortEntityData:(NSString *)fieldName
comparisonSelector = @selector(caseInsensitiveCompare:);
}
- [columnObjs setObject:valueObj forKey:[NSString stringWithFormat:@"%ld", rowNum]];
+ columnObjs[[NSString stringWithFormat:@"%ld", rowNum]] = valueObj;
rowNum++;
}
@@ -252,7 +239,7 @@ - (void)sortEntityData:(NSString *)fieldName
NSMutableArray *temp = [[NSMutableArray alloc] init];
for (NSString *oldRowNum in sortedColumns)
{
- [temp addObject:[self.entityData objectAtIndex:[oldRowNum integerValue]]];
+ [temp addObject:(self.entityData)[[oldRowNum integerValue]]];
}
self.entityData = temp;
}
@@ -348,9 +335,9 @@ - (NSArray*) keyPathsForEntity:(NSEntityDescription*) entityDescription {
}
- (NSError *)errnoErrorWithReason:(NSString *)reason {
- NSString *errMsg = [NSString stringWithUTF8String:strerror(errno)];
- NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:errMsg, NSLocalizedDescriptionKey,
- reason, NSLocalizedFailureReasonErrorKey, nil];
+ NSString *errMsg = @(strerror(errno));
+ NSDictionary *userInfo = @{NSLocalizedDescriptionKey: errMsg,
+ NSLocalizedFailureReasonErrorKey: reason};
return [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:userInfo];
}
@@ -376,7 +363,7 @@ - (void) loadEntityDataAtIndex: (NSUInteger) index {
}
- (NSString*) entityAtIndex:(NSUInteger) index {
- return [self.entities objectAtIndex:index];
+ return (self.entities)[index];
}
- (NSUInteger) entityDataCountAtIndex: (NSUInteger) index
@@ -394,7 +381,7 @@ - (NSUInteger) entityDataCount {
}
- (NSArray*) getDataAtRow: (NSUInteger) row {
- return [self.entityData objectAtIndex:row];
+ return (self.entityData)[row];
}
- (NSInteger)getCurrentHistoryIndex
@@ -433,8 +420,8 @@ - (void)updateCoreDataHistory:(NSString *)name :(NSPredicate *)predicate
// handle any duplicate objects that are side-by-side
if (([self.coreDataHistory count] >= 2) && (currentHistoryIndex <= [self.coreDataHistory count] - 2))
{
- CoreDataHistoryObject *currentObj = [self.coreDataHistory objectAtIndex:currentHistoryIndex];
- CoreDataHistoryObject *nextObj = [self.coreDataHistory objectAtIndex:currentHistoryIndex + 1];
+ CoreDataHistoryObject *currentObj = (self.coreDataHistory)[currentHistoryIndex];
+ CoreDataHistoryObject *nextObj = (self.coreDataHistory)[currentHistoryIndex + 1];
if ([currentObj isEqualTo:nextObj] ||
[[self fetchObjectsByEntityName:currentObj.entityName :currentObj.predicate] isEqualTo:[self fetchObjectsByEntityName:nextObj.entityName :nextObj.predicate]])
{
View
3 CoreDataUtil/CoreDataHistoryObject.m
@@ -10,9 +10,6 @@
@implementation CoreDataHistoryObject
-@synthesize entityName;
-@synthesize predicate;
-
- (BOOL)isEqualTo:(id)object
{
if ([object isKindOfClass:[CoreDataHistoryObject class]])
View
2 CoreDataUtil/EntityDataTableView.m
@@ -121,7 +121,7 @@ - (void) copySelectedRow: (BOOL) escapeSpecialChars {
// Next Index
currentIndex = [indexSet indexGreaterThanIndex: currentIndex];
}
- [pb declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner:nil];
+ [pb declareTypes:@[NSStringPboardType] owner:nil];
[pb setString:[NSString stringWithString:textBuf] forType:NSStringPboardType];
}
}
View
8 CoreDataUtil/EntityDataTableViewCell.m
@@ -22,7 +22,6 @@ - (NSMutableArray *)splitStringIntoCharArray:(NSString *)string;
@implementation EntityDataTableViewCell
-@synthesize cellText = _cellText;
- (CellType)getCellType
{
@@ -131,9 +130,8 @@ - (void)drawText:(NSRect)cellFrame
}
textOrigin.y = cellFrame.origin.y;
- NSDictionary *textAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSColor blackColor], NSForegroundColorAttributeName,
- textFont, NSFontAttributeName, nil];
+ NSDictionary *textAttributes = @{NSForegroundColorAttributeName: [NSColor blackColor],
+ NSFontAttributeName: textFont};
NSString *text = self.cellText;
if ([self widthOfString:text withFont:textFont] >= maxWidth)
@@ -160,7 +158,7 @@ - (void)drawText:(NSRect)cellFrame
- (CGFloat)widthOfString:(NSString *)string withFont:(NSFont *)font
{
- NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil];
+ NSDictionary *attributes = @{NSFontAttributeName: font};
return [[[NSAttributedString alloc] initWithString:string attributes:attributes] size].width;
}
View
22 CoreDataUtil/GetInfoSheetController.m
@@ -28,14 +28,6 @@ - (void)populateOutlineView;
@implementation GetInfoSheetController
-@synthesize entityNameTextField = _entityNameTextField;
-@synthesize entityUserInfoTableView = _entityUserInfoTableView;
-@synthesize entityDescriptionOutlineView = _entityDescriptionOutlineView;
-@synthesize parentCells = _parentCells;
-@synthesize childCells = _childCells;
-@synthesize initialValues = _initialValues;
-@synthesize entityUserInfo = _entityUserInfo;
-
- (id)initWithWindowNibName:(NSString *)windowNibName
{
self = [super initWithWindowNibName:windowNibName];
@@ -76,7 +68,7 @@ - (void)removeColumns
{
while ([[self entityUserInfoTableView] numberOfColumns] > 0)
{
- [self.entityUserInfoTableView removeTableColumn:[[self.entityUserInfoTableView tableColumns] objectAtIndex:0]];
+ [self.entityUserInfoTableView removeTableColumn:[self.entityUserInfoTableView tableColumns][0]];
}
}
@@ -344,7 +336,7 @@ - (void)populateOutlineView
}
[self.parentCells addObject:parent];
- [self.childCells setObject:[self createCellChildrenCells:property] forKey:key];
+ (self.childCells)[key] = [self createCellChildrenCells:property];
}
}
@@ -379,7 +371,7 @@ - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id
else
{
EntityDataTableViewCell *parent = (EntityDataTableViewCell *)item;
- return [[self.childCells objectForKey:parent.cellText] count];
+ return [(self.childCells)[parent.cellText] count];
}
}
@@ -399,11 +391,11 @@ - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id
EntityDataTableViewCell *cell = (EntityDataTableViewCell *)item;
if (cell == nil)
{
- return [self.parentCells objectAtIndex:index];
+ return (self.parentCells)[index];
}
else
{
- return [[self.childCells objectForKey:cell.cellText] objectAtIndex:index];
+ return (self.childCells)[cell.cellText][index];
}
}
@@ -435,7 +427,7 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
- NSString *key = [[self.entityUserInfo allKeys] objectAtIndex:rowIndex];
+ NSString *key = [self.entityUserInfo allKeys][rowIndex];
if ([[aTableColumn identifier] isEqualToString:@"Key"])
{
@@ -443,7 +435,7 @@ - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColu
}
else
{
- return [self.entityUserInfo objectForKey:key];
+ return (self.entityUserInfo)[key];
}
}
View
3 CoreDataUtil/InAppPurchaseTableCellView.m
@@ -10,9 +10,6 @@
@implementation InAppPurchaseTableCellView
-@synthesize infoField = _infoField;
-@synthesize priceField = _priceField;
-
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
View
5 CoreDataUtil/InAppPurchaseWindowController.m
@@ -16,7 +16,6 @@ @interface InAppPurchaseWindowController ()
@implementation InAppPurchaseWindowController
-@synthesize inAppPurchaseTableView;
- (id)initWithWindowNibName:(NSString *)windowNibName
{
@@ -105,7 +104,7 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
- SKProduct *product = [[MFLInAppPurchaseHelperSubclass sharedHelper].products objectAtIndex:row];
+ SKProduct *product = ([MFLInAppPurchaseHelperSubclass sharedHelper].products)[row];
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
@@ -152,7 +151,7 @@ - (IBAction)buyAction:(id)sender {
return;
}
- SKProduct *product = [[MFLInAppPurchaseHelperSubclass sharedHelper].products objectAtIndex:selectedRow];
+ SKProduct *product = ([MFLInAppPurchaseHelperSubclass sharedHelper].products)[selectedRow];
[[MFLInAppPurchaseHelperSubclass sharedHelper] buyProduct:product];
}
View
70 CoreDataUtil/MFLAppDelegate.m
@@ -25,23 +25,17 @@ - (void) addRecentDocument: (NSURL*) recentDocumentUrl;
@implementation MFLAppDelegate
-@synthesize openFileSheetController = _openFileSheetController;
-@synthesize inAppPurchaseSheetController = _inAppPurchaseSheetController;
-@synthesize mainWindowController = _mainWindowController;
-@synthesize projectHasChanged = _projectHasChanged;
-@synthesize window = _window;
-
- (BOOL) openFileHelper: (NSString*) filename {
if ([filename hasSuffix:MFL_COREDATA_PROJECT_EXTENSION]) {
NSLog(@"Load Project File: [%@]", filename);
NSDictionary* project = [NSDictionary dictionaryWithContentsOfFile:filename];
- NSString* momFilePath = [project objectForKey:MFL_MOM_FILE_KEY];
- NSString* dbFilePath = [project objectForKey:MFL_DB_FILE_KEY];
- NSNumber* persistenceFormat = [project objectForKey:MFL_DB_FORMAT_KEY];
+ NSString* momFilePath = project[MFL_MOM_FILE_KEY];
+ NSString* dbFilePath = project[MFL_DB_FILE_KEY];
+ NSNumber* persistenceFormat = project[MFL_DB_FORMAT_KEY];
if (persistenceFormat == nil) {
- persistenceFormat = [NSNumber numberWithInt:MFL_SQLiteStoreType];
+ persistenceFormat = @MFL_SQLiteStoreType;
}
NSURL* momUrl = nil;
@@ -66,9 +60,7 @@ - (BOOL) openFileHelper: (NSString*) filename {
} else if ([filename hasSuffix:MFL_MOM_FILE_EXTENSION]) {
NSLog(@"Load MOM File: [%@]", filename);
//NSURL* momUrl = [NSURL fileURLWithPath:filename];
- NSDictionary* initialValue = [NSDictionary dictionaryWithObjectsAndKeys:
- filename, MFL_MOM_FILE_KEY,
- nil];
+ NSDictionary* initialValue = @{MFL_MOM_FILE_KEY: filename};
if (self.openFileSheetController != nil) {
NSBeep();
@@ -78,15 +70,15 @@ - (BOOL) openFileHelper: (NSString*) filename {
self.openFileSheetController = [[OpenFileSheetController alloc] initWithWindowNibName:@"OpenFileSheetController"];
NSDictionary *newValues = [self.openFileSheetController show:self.window: initialValue];
self.openFileSheetController = nil;
- if ([newValues objectForKey:MFL_MOM_FILE_KEY] != nil && [newValues objectForKey:MFL_DB_FILE_KEY] != nil)
+ if (newValues[MFL_MOM_FILE_KEY] != nil && newValues[MFL_DB_FILE_KEY] != nil)
{
- NSNumber* persistenceFormat = [newValues objectForKey:MFL_DB_FORMAT_KEY];
+ NSNumber* persistenceFormat = newValues[MFL_DB_FORMAT_KEY];
if (persistenceFormat == nil) {
- persistenceFormat = [NSNumber numberWithInt:MFL_SQLiteStoreType];
+ persistenceFormat = @MFL_SQLiteStoreType;
}
- BOOL result = [self.mainWindowController openFiles:[newValues objectForKey:MFL_MOM_FILE_KEY] :[newValues objectForKey:MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
+ BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] :newValues[MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
if (result)
{
@@ -116,15 +108,15 @@ - (BOOL) openFileHelper: (NSString*) filename {
self.openFileSheetController = [[OpenFileSheetController alloc] initWithWindowNibName:@"OpenFileSheetController"];
NSDictionary *newValues = [self.openFileSheetController show:self.window: project];
self.openFileSheetController = nil;
- if ([newValues objectForKey:MFL_MOM_FILE_KEY] != nil && [newValues objectForKey:MFL_DB_FILE_KEY] != nil)
+ if (newValues[MFL_MOM_FILE_KEY] != nil && newValues[MFL_DB_FILE_KEY] != nil)
{
- NSNumber* persistenceFormat = [newValues objectForKey:MFL_DB_FORMAT_KEY];
+ NSNumber* persistenceFormat = newValues[MFL_DB_FORMAT_KEY];
if (persistenceFormat == nil) {
- persistenceFormat = [NSNumber numberWithInt:MFL_SQLiteStoreType];
+ persistenceFormat = @MFL_SQLiteStoreType;
}
- BOOL result = [self.mainWindowController openFiles:[newValues objectForKey:MFL_MOM_FILE_KEY] :[newValues objectForKey:MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
+ BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] :newValues[MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
if (result)
{
@@ -177,8 +169,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
// If there is a recent document, try to open it.
if ([documents count] > 0)
{
- [self openFileHelper:[[documents objectAtIndex:0] path]];
- if ([[[documents objectAtIndex:0] absoluteString] hasSuffix:MFL_COREDATA_PROJECT_EXTENSION])
+ [self openFileHelper:[documents[0] path]];
+ if ([[documents[0] absoluteString] hasSuffix:MFL_COREDATA_PROJECT_EXTENSION])
{
self.projectHasChanged = false;
}
@@ -205,7 +197,7 @@ - (IBAction)openAction:(id)sender
{
NSLog(@"openAction: [%@]", sender);
[self.window makeKeyAndOrderFront:self];
- NSArray *fileTypes = [[NSArray alloc] initWithObjects:MFL_COREDATA_PROJECT_EXTENSION, MFL_COREDATA_PROJECT_EXTENSION_UPERCASE, MFL_COREDATA_EDITOR_PROJECT_EXTENSION, nil];
+ NSArray *fileTypes = @[MFL_COREDATA_PROJECT_EXTENSION, MFL_COREDATA_PROJECT_EXTENSION_UPERCASE, MFL_COREDATA_EDITOR_PROJECT_EXTENSION];
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
[openDlg setCanChooseFiles:YES];
@@ -213,7 +205,7 @@ - (IBAction)openAction:(id)sender
if ([openDlg runModal] == NSOKButton)
{
- NSString *filename = [[[openDlg URLs] objectAtIndex:0] path];
+ NSString *filename = [[openDlg URLs][0] path];
[self openFileHelper:filename];
}
}
@@ -229,15 +221,15 @@ - (IBAction)newAction:(id)sender
self.openFileSheetController = [[OpenFileSheetController alloc] initWithWindowNibName:@"OpenFileSheetController"];
NSDictionary *newValues = [self.openFileSheetController show:self.window];
self.openFileSheetController = nil;
- if ([newValues objectForKey:MFL_MOM_FILE_KEY] != nil && [newValues objectForKey:MFL_DB_FILE_KEY] != nil)
+ if (newValues[MFL_MOM_FILE_KEY] != nil && newValues[MFL_DB_FILE_KEY] != nil)
{
- NSNumber* persistenceFormat = [newValues objectForKey:MFL_DB_FORMAT_KEY];
+ NSNumber* persistenceFormat = newValues[MFL_DB_FORMAT_KEY];
if (persistenceFormat == nil) {
- persistenceFormat = [NSNumber numberWithInt:MFL_SQLiteStoreType];
+ persistenceFormat = @MFL_SQLiteStoreType;
}
- BOOL result = [self.mainWindowController openFiles:[newValues objectForKey:MFL_MOM_FILE_KEY] :[newValues objectForKey:MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
+ BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] :newValues[MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
if (result) {
self.projectHasChanged = true;
@@ -249,7 +241,7 @@ - (IBAction)showStoreInFinder:(id)sender {
if (self.mainWindowController == nil) {return;}
if (self.mainWindowController.persistenceFileUrl == nil) {return; }
- NSArray *fileURLs = [NSArray arrayWithObjects:self.mainWindowController.persistenceFileUrl, nil];
+ NSArray *fileURLs = @[self.mainWindowController.persistenceFileUrl];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];
}
@@ -257,7 +249,7 @@ - (IBAction)showModelInFinder:(id)sender {
if (self.mainWindowController == nil) {return;}
if (self.mainWindowController.momFileUrl == nil) {return; }
- NSArray *fileURLs = [NSArray arrayWithObjects:self.mainWindowController.momFileUrl, nil];
+ NSArray *fileURLs = @[self.mainWindowController.momFileUrl];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];
}
@@ -310,23 +302,21 @@ - (IBAction)saveAction:(id)sender
if (momfileUrl != nil)
{
- NSArray *fileTypes = [[NSArray alloc] initWithObjects:MFL_COREDATA_PROJECT_EXTENSION, MFL_COREDATA_PROJECT_EXTENSION_UPERCASE, MFL_COREDATA_EDITOR_PROJECT_EXTENSION, nil];
+ NSArray *fileTypes = @[MFL_COREDATA_PROJECT_EXTENSION, MFL_COREDATA_PROJECT_EXTENSION_UPERCASE, MFL_COREDATA_EDITOR_PROJECT_EXTENSION];
NSSavePanel* saveDlg = [NSSavePanel savePanel];
[saveDlg setAllowedFileTypes:fileTypes];
NSArray *documents = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSString *documentURLString = [URL_FILE_BEGINNING stringByAppendingString:[documents objectAtIndex:0]];
+ NSString *documentURLString = [URL_FILE_BEGINNING stringByAppendingString:documents[0]];
[saveDlg setDirectoryURL:[NSURL URLWithString:documentURLString]];
if ([saveDlg runModal] == NSSaveAsOperation)
{
- NSDictionary *stuffToSave = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:1], MFL_PROJECT_FILE_VERSION_KEY,
- [momfileUrl absoluteString], MFL_MOM_FILE_KEY,
- [NSNumber numberWithInt:(int)persistenceType], MFL_DB_FORMAT_KEY,
- [persistenceUrl absoluteString], MFL_DB_FILE_KEY,
- nil];
+ NSDictionary *stuffToSave = @{MFL_PROJECT_FILE_VERSION_KEY: @1,
+ MFL_MOM_FILE_KEY: [momfileUrl absoluteString],
+ MFL_DB_FORMAT_KEY: @((int)persistenceType),
+ MFL_DB_FILE_KEY: [persistenceUrl absoluteString]};
if (![stuffToSave writeToURL:[saveDlg URL] atomically:NO])
{
@@ -398,7 +388,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende
- (IBAction)reportAnIssueAction:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://fluentfactory.com/support_ticket.php"]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/yepher/CoreDataUtility/issues"]];
}
@end
View
3 CoreDataUtil/MFLButtonTableViewCell.m
@@ -17,9 +17,6 @@ @interface MFLButtonTableViewCell ()
@implementation MFLButtonTableViewCell
-@synthesize infoField = _infoField;
-@synthesize cellButton = _cellButton;
-
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
View
7 CoreDataUtil/MFLEntityTableCellView.m
@@ -14,9 +14,6 @@
@implementation MFLEntityTableCellView
-@synthesize label = _label;
-@synthesize countButton = _countButton;
-
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
@@ -30,13 +27,13 @@ - (id)initWithFrame:(NSRect)frame
- (CGFloat)widthOfString:(NSString *)string withFont:(NSFont *)font
{
- NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil];
+ NSDictionary *attributes = @{NSFontAttributeName: font};
return [[[NSAttributedString alloc] initWithString:string attributes:attributes] size].width;
}
- (CGFloat)heightOfString:(NSString *)string withFont:(NSFont *)font
{
- NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil];
+ NSDictionary *attributes = @{NSFontAttributeName: font};
return [[[NSAttributedString alloc] initWithString:string attributes:attributes] size].height;
}
View
34 CoreDataUtil/MFLMainWindowController.m
@@ -41,22 +41,6 @@ - (NSEntityDescription *)getEntityForPredicateEditor;
@implementation MFLMainWindowController
-@synthesize coreDataIntrospection = _coreDataIntrospection;
-@synthesize dateStyle = _dateStyle;
-@synthesize sortType = _sortType;
-@synthesize lastColumn = _lastColumn;
-@synthesize baseRowTemplates = _baseRowTemplates;
-@synthesize predicateEditor = _predicateEditor;
-
-
-@synthesize userSelecteddateFormat = _userSelecteddateFormat;
-@synthesize dataSourceList = _dataSourceList;
-@synthesize entityContentTable = _entityContentTable;
-@synthesize predicateSheet = _predicateSheet;
-@synthesize preferenceSheetMatrix = _preferenceSheetMatrix;
-@synthesize generatedPredicateLabel = _generatedPredicateLabel;
-@synthesize historySegmentedControl = _historySegmentedControl;
-
- (id)initWithWindow:(NSWindow *)window
{
@@ -152,7 +136,7 @@ - (void)addTableColumnWithIdentifier:(NSString *)ident
// }
NSMutableDictionary *bindingOptions=[NSMutableDictionary dictionary];
- [bindingOptions setObject:[NSNumber numberWithBool:YES] forKey:NSValidatesImmediatelyBindingOption];
+ bindingOptions[NSValidatesImmediatelyBindingOption] = @YES;
// You can probably do some sort of dynamic binding here:
//NSString *keyPath = [NSString stringWithFormat:@"arrangedObjects.%@", ident];
@@ -165,7 +149,7 @@ - (void) removeColumns
//NSLog(@"==== removeColumns");
while ([[self entityContentTable] numberOfColumns] > 0)
{
- [self.entityContentTable removeTableColumn:[[self.entityContentTable tableColumns] objectAtIndex:0]];
+ [self.entityContentTable removeTableColumn:[self.entityContentTable tableColumns][0]];
}
//NSLog(@"There are now %ld columns", [[self entityContentTable] numberOfColumns]);
}
@@ -630,7 +614,7 @@ - (IBAction)entityCellButtonClicked:(id)sender
NSInteger column = [self.dataSourceList columnForView:sender];
NSArray *columns = [self.entityContentTable tableColumns];
- id valueObj = [self getValueObjFromDataRows:self.entityContentTable :row :[columns objectAtIndex:column]];
+ id valueObj = [self getValueObjFromDataRows:self.entityContentTable :row :columns[column]];
if (valueObj != nil)
{
@@ -646,8 +630,8 @@ - (IBAction)entityCellButtonClicked:(id)sender
{
NSArray *array = (NSArray *)valueObj;
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF IN %@", array];
- [self reloadEntityDataTable:[[[array objectAtIndex:0] entity] name] :predicate];
- [self.coreDataIntrospection updateCoreDataHistory:[[[array objectAtIndex:0] entity] name] :predicate];
+ [self reloadEntityDataTable:[[array[0] entity] name] :predicate];
+ [self.coreDataIntrospection updateCoreDataHistory:[[array[0] entity] name] :predicate];
[self enableDisableHistorySegmentedControls];
}
else if ([valueObj isKindOfClass:[NSSet class]])
@@ -669,7 +653,7 @@ - (IBAction) historyToolbarItemSelected:(id)sender
if ([control selectedSegment] == 0 && [self canEnableBackHistoryControl])
{
[self.coreDataIntrospection setCurrentHistoryIndex:currentIndex+1];
- CoreDataHistoryObject *historyObj = [self.coreDataIntrospection.coreDataHistory objectAtIndex:[self.coreDataIntrospection getCurrentHistoryIndex]];
+ CoreDataHistoryObject *historyObj = (self.coreDataIntrospection.coreDataHistory)[[self.coreDataIntrospection getCurrentHistoryIndex]];
[self reloadEntityDataTable:historyObj.entityName :historyObj.predicate];
[self enableDisableHistorySegmentedControls];
}
@@ -677,7 +661,7 @@ - (IBAction) historyToolbarItemSelected:(id)sender
else if ([control selectedSegment] == 1 && [self canEnableForwardHistoryControl])
{
[self.coreDataIntrospection setCurrentHistoryIndex:currentIndex-1];
- CoreDataHistoryObject *historyObj = [self.coreDataIntrospection.coreDataHistory objectAtIndex:[self.coreDataIntrospection getCurrentHistoryIndex]];
+ CoreDataHistoryObject *historyObj = (self.coreDataIntrospection.coreDataHistory)[[self.coreDataIntrospection getCurrentHistoryIndex]];
[self reloadEntityDataTable:historyObj.entityName :historyObj.predicate];
[self enableDisableHistorySegmentedControls];
}
@@ -750,7 +734,7 @@ - (NSEntityDescription *)getEntityForPredicateEditor
{
if (self.coreDataIntrospection.coreDataHistory != nil && [self.coreDataIntrospection.coreDataHistory count] > 0)
{
- CoreDataHistoryObject *historyObj = [self.coreDataIntrospection.coreDataHistory objectAtIndex:[self.coreDataIntrospection getCurrentHistoryIndex]];
+ CoreDataHistoryObject *historyObj = (self.coreDataIntrospection.coreDataHistory)[[self.coreDataIntrospection getCurrentHistoryIndex]];
entityDescription = [self.coreDataIntrospection entityDescriptionForName:historyObj.entityName];
}
}
@@ -789,7 +773,7 @@ - (IBAction)showPredicateEditor:(id)sender
NSMutableArray* allTemplates = [NSMutableArray arrayWithArray:self.baseRowTemplates];
if (self.coreDataIntrospection.coreDataHistory != nil && [self.coreDataIntrospection.coreDataHistory count] > 0)
{
- CoreDataHistoryObject *historyObj = [self.coreDataIntrospection.coreDataHistory objectAtIndex:[self.coreDataIntrospection getCurrentHistoryIndex]];
+ CoreDataHistoryObject *historyObj = (self.coreDataIntrospection.coreDataHistory)[[self.coreDataIntrospection getCurrentHistoryIndex]];
NSPredicateEditorRowTemplate *row = [[NSPredicateEditorRowTemplate alloc] init];
[row setPredicate:historyObj.predicate];
[allTemplates addObject:row];
View
1 CoreDataUtil/MFLTextTableCellView.m
@@ -10,7 +10,6 @@
@implementation MFLTextTableCellView
-@synthesize infoField = _infoField;
- (id)initWithFrame:(NSRect)frame
{
View
26 CoreDataUtil/OpenFileSheetController.m
@@ -35,32 +35,6 @@ - (void)clearComboSelector;
@implementation OpenFileSheetController
-@synthesize tabView = _tabView;
-@synthesize fileTabModelTextField = _fileTabModelTextField;
-@synthesize fileTabPersistenceTextField = _fileTabPersistenceTextField;
-@synthesize fileTabPersistenceFormat = _fileTabPersistenceFormat;
-@synthesize processTabModelTextField = _processTabModelTextField;
-@synthesize processTabPersistenceTextField = _processTabPersistenceTextField;
-@synthesize processTabPersistenceFormat = _processTabPersistenceFormat;
-@synthesize simulatorTabModelTextField = _simulatorTabModelTextField;
-@synthesize simulatorTabPersistenceTextField = _simulatorTabPersistenceTextField;
-@synthesize fileTabPersistenceFileButton = _fileTabPersistenceFileButton;
-@synthesize fileTabSimulatorDirectoryButton = _fileTabSimulatorDirectoryButton;
-@synthesize processTabPersistenceFileButton = _processTabPersistenceFileButton;
-@synthesize processTabAppSupportButton = _processTabAppSupportButton;
-@synthesize simulatorTabPersistenceFileButton = _simulatorTabPersistenceFileButton;
-@synthesize simulatorTabSimulatorDirectoryButton = _simulatorTabSimulatorDirectoryButton;
-@synthesize simulatorTabPersistenceFormat = _simulatorTabPersistenceFormat;
-@synthesize openButton = _openButton;
-@synthesize processSelectorBox = _processSelectorBox;
-@synthesize comboSelectorDialog = _comboSelectorDialog;
-
-@synthesize initialValues = _initialValues;
-@synthesize momFileUrl = _momFileUrl;
-@synthesize dbFileUrl = _dbFileUrl;
-@synthesize savedFields = _savedFields;
-@synthesize processList = _processList;
-@synthesize simulatorUrlList = _simulatorUrlList;
- (id)initWithWindowNibName:(NSString *)windowNibName
{
View
10 CoreDataUtil/Utils/MFLCoreDataEditorProjectLoader.m
@@ -52,17 +52,15 @@ - (NSDictionary*) decodeProjectFile: (NSString*) projectFilePath {
NSArray* results = [self executeFetchRequest:managedObjectContext :fetchRequest];
if (results != nil && [results count] > 0) {
- NSManagedObject* object = [results objectAtIndex:0];
+ NSManagedObject* object = results[0];
NSURL* modelURL = [object valueForKey:@"modelURL"];
NSURL* storeURL = [object valueForKey:@"storeURL"];
NSLog(@"modelURL: %@\nstoreURL: %@",modelURL, storeURL);
- NSDictionary* newValues = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:MFL_SQLiteStoreType], MFL_DB_FORMAT_KEY,
- [modelURL path], MFL_MOM_FILE_KEY,
- [storeURL path], MFL_DB_FILE_KEY,
- nil];
+ NSDictionary* newValues = @{MFL_DB_FORMAT_KEY: @MFL_SQLiteStoreType,
+ MFL_MOM_FILE_KEY: [modelURL path],
+ MFL_DB_FILE_KEY: [storeURL path]};
return newValues;
}
View
5 CoreDataUtil/Utils/MFLInAppPurchaseHelper.m
@@ -11,11 +11,6 @@
@implementation MFLInAppPurchaseHelper
-@synthesize productIdentifiers = _productIdentifiers;
-@synthesize products = _products;
-@synthesize purchasedProducts = _purchasedProducts;
-@synthesize request = _request;
-
- (id)initWithProductIdentifiers:(NSSet *)productIds
{
if ((self = [super init]))
View
2 README.md
@@ -60,6 +60,8 @@ In many ways CoreDataUtility is similar to CoreDataEditor.
This tool looks really cool but I never quite figured it out:
http://pmougin.wordpress.com/2010/04/11/core-data-browser-app/
+This tool looks good:
+ http://corner.squareup.com/2012/08/ponydebugger-remote-debugging.html
TODO
===============

0 comments on commit 12d56c7

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