Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes compiler warnings after Xcode update.

  • Loading branch information...
commit 89a0d597233e6076b3f062692dbb3a16ec8dd3ba 1 parent 12d56c7
Chris Wilson authored
View
17 .gitignore
@@ -0,0 +1,17 @@
+# Xcode
+.DS_Store
+build/
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+*.xcworkspace
+!default.xcworkspace
+xcuserdata
+profile
+*.moved-aside
+DerivedData
View
16 CoreDataUtil.xcodeproj/project.pbxproj
@@ -469,7 +469,7 @@
C1CEFE481463779C00466EB3 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0440;
+ LastUpgradeCheck = 0460;
ORGANIZATIONNAME = "mFluent LLC";
};
buildConfigurationList = C1CEFE4B1463779C00466EB3 /* Build configuration list for PBXProject "CoreDataUtil" */;
@@ -666,6 +666,11 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
@@ -680,9 +685,11 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
+ PROVISIONING_PROFILE = "";
SDKROOT = macosx;
};
name = Debug;
@@ -693,6 +700,11 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -701,8 +713,10 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
+ PROVISIONING_PROFILE = "";
SDKROOT = macosx;
};
name = Release;
View
BIN  CoreDataUtil.xcodeproj/project.xcworkspace/xcuserdata/chris.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
96 CoreDataUtil.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/CoreDataUtil.xcscheme
@@ -1,96 +0,0 @@
-<?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
@@ -1,59 +0,0 @@
-<?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
BIN  CoreDataUtil/.DS_Store
Binary file not shown
View
4 CoreDataUtil/CoreData/MFLCoreDataIntrospection.h
@@ -54,9 +54,9 @@
- (NSUndoManager*) undoManager;
-- (void) applyPredicate: (NSString*) entityName: (NSPredicate*) predicate;
+- (void) applyPredicate: (NSString*) entityName predicate:(NSPredicate*) predicate;
- (void)sortEntityData:(NSString *)fieldName;
-+ (id)getDisplayValueForObject:(id)obj: (NSDateFormatterStyle) dateStyle;
++ (id)getDisplayValueForObject:(id)obj dateStyle:(NSDateFormatterStyle) dateStyle;
- (NSInteger)getCurrentHistoryIndex;
- (void)setCurrentHistoryIndex:(NSInteger)currentIndex;
- (void)updateCoreDataHistory:(NSString *)name :(NSPredicate *)predicate;
View
6 CoreDataUtil/CoreData/MFLCoreDataIntrospection.m
@@ -196,7 +196,7 @@ - (NSArray*) fetchObjectsByEntityName: (NSString*) entityName :(NSPredicate*) pr
return fetchedObjects;
}
-- (void) applyPredicate: (NSString*) entityName: (NSPredicate*) predicate {
+- (void) applyPredicate: (NSString*) entityName predicate:(NSPredicate*) predicate {
self.entityData = [self fetchObjectsByEntityName:entityName: predicate];
}
@@ -214,7 +214,7 @@ - (void)sortEntityData:(NSString *)fieldName
NSInteger rowNum = 0;
for (NSArray *row in self.entityData)
{
- id valueObj = [MFLCoreDataIntrospection getDisplayValueForObject:[row valueForKey:fieldName]: self.dateStyle];
+ id valueObj = [MFLCoreDataIntrospection getDisplayValueForObject:[row valueForKey:fieldName] dateStyle:self.dateStyle];
if ([valueObj isKindOfClass:[NSString class]] && [formatter dateFromString:valueObj])
{
valueObj = [formatter dateFromString:valueObj];
@@ -244,7 +244,7 @@ - (void)sortEntityData:(NSString *)fieldName
self.entityData = temp;
}
-+ (id)getDisplayValueForObject:(id)obj: (NSDateFormatterStyle) dateStyle
++ (id)getDisplayValueForObject:(id)obj dateStyle:(NSDateFormatterStyle) dateStyle
{
if (obj == nil)
{
View
8 CoreDataUtil/MFLAppDelegate.m
@@ -47,7 +47,7 @@ - (BOOL) openFileHelper: (NSString*) filename {
if (dbFilePath != nil) {
dbUrl = [NSURL URLWithString:dbFilePath];
}
- BOOL result = [self.mainWindowController openFiles: momUrl: dbUrl: [persistenceFormat intValue]];
+ BOOL result = [self.mainWindowController openFiles: momUrl persistenceFile:dbUrl persistenceType:[persistenceFormat intValue]];
if (result)
{
@@ -78,7 +78,7 @@ - (BOOL) openFileHelper: (NSString*) filename {
persistenceFormat = @MFL_SQLiteStoreType;
}
- BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] :newValues[MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
+ BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] persistenceFile:newValues[MFL_DB_FILE_KEY] persistenceType:[persistenceFormat intValue]];
if (result)
{
@@ -116,7 +116,7 @@ - (BOOL) openFileHelper: (NSString*) filename {
persistenceFormat = @MFL_SQLiteStoreType;
}
- BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] :newValues[MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
+ BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] persistenceFile:newValues[MFL_DB_FILE_KEY] persistenceType:[persistenceFormat intValue]];
if (result)
{
@@ -229,7 +229,7 @@ - (IBAction)newAction:(id)sender
persistenceFormat = @MFL_SQLiteStoreType;
}
- BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] :newValues[MFL_DB_FILE_KEY]: [persistenceFormat intValue]];
+ BOOL result = [self.mainWindowController openFiles:newValues[MFL_MOM_FILE_KEY] persistenceFile:newValues[MFL_DB_FILE_KEY] persistenceType:[persistenceFormat intValue]];
if (result) {
self.projectHasChanged = true;
View
8 CoreDataUtil/MFLCellBuilder.h
@@ -15,10 +15,10 @@
@interface MFLCellBuilder : NSObject
-+ (MFLTextTableCellView* ) textCellWithString:(NSTableView *)tableView: (NSString*) textToSet: (id) owner;
-+ (MFLTextTableCellView* ) numberCellWithString:(NSTableView *)tableView: (NSString*) textToSet: (id) owner;
-+ (MFLTextTableCellView* ) nullCell:(NSTableView *)tableView: (id) owner;
-+ (MFLButtonTableViewCell* ) objectCellWithString:(NSTableView *)tableView: (NSString*) textToSet: (id) owner;
++ (MFLTextTableCellView* ) textCellWithString:(NSTableView *)tableView textToSet:(NSString*) textToSet owner:(id) owner;
++ (MFLTextTableCellView* ) numberCellWithString:(NSTableView *)tableView textToSet: (NSString*) textToSet owner:(id) owner;
++ (MFLTextTableCellView* ) nullCell:(NSTableView *)tableView owner:(id) owner;
++ (MFLButtonTableViewCell* ) objectCellWithString:(NSTableView *)tableView textToSet:(NSString*) textToSet owner:(id) owner;
+ (InAppPurchaseTableCellView *)inAppPurchaseCellWithString:(NSTableView *)tableView :(NSString *)textToSet :(NSString *)priceText :(NSInteger)row :(id)owner;
@end
View
8 CoreDataUtil/MFLCellBuilder.m
@@ -17,7 +17,7 @@ @implementation MFLCellBuilder
#pragma mark -
#pragma mark Data Cell Helper
-+ (MFLTextTableCellView* ) textCellWithString:(NSTableView *)tableView: (NSString*) textToSet: (id) owner {
++ (MFLTextTableCellView* ) textCellWithString:(NSTableView *)tableView textToSet:(NSString*) textToSet owner:(id) owner {
MFLTextTableCellView* textCell = [tableView makeViewWithIdentifier:MFL_TEXT_CELL owner:owner];
[[textCell infoField] setAlignment:NSLeftTextAlignment];
@@ -28,7 +28,7 @@ + (MFLTextTableCellView* ) textCellWithString:(NSTableView *)tableView: (NSStrin
return textCell;
}
-+ (MFLTextTableCellView* ) numberCellWithString:(NSTableView *)tableView: (NSString*) textToSet: (id) owner {
++ (MFLTextTableCellView* ) numberCellWithString:(NSTableView *)tableView textToSet:(NSString*) textToSet owner: (id) owner {
MFLTextTableCellView* textCell = [tableView makeViewWithIdentifier:MFL_TEXT_CELL owner:owner];
[[textCell infoField] setAlignment:NSRightTextAlignment];
@@ -39,7 +39,7 @@ + (MFLTextTableCellView* ) numberCellWithString:(NSTableView *)tableView: (NSStr
return textCell;
}
-+ (MFLTextTableCellView* ) nullCell:(NSTableView *)tableView: (id) owner {
++ (MFLTextTableCellView* ) nullCell:(NSTableView *)tableView owner: (id) owner {
MFLTextTableCellView* textCell = [tableView makeViewWithIdentifier:MFL_TEXT_CELL owner:owner];
[[textCell infoField] setAlignment:NSRightTextAlignment];
@@ -50,7 +50,7 @@ + (MFLTextTableCellView* ) nullCell:(NSTableView *)tableView: (id) owner {
return textCell;
}
-+ (MFLButtonTableViewCell* ) objectCellWithString:(NSTableView *)tableView: (NSString*) textToSet: (id) owner {
++ (MFLButtonTableViewCell* ) objectCellWithString:(NSTableView *)tableView textToSet:(NSString*) textToSet owner:(id) owner {
MFLButtonTableViewCell* buttonCell = [tableView makeViewWithIdentifier:MFL_BUTTON_CELL owner:owner];
[[buttonCell infoField] setAlignment:NSRightTextAlignment];
View
2  CoreDataUtil/MFLMainWindowController.h
@@ -24,7 +24,7 @@
@property (weak) IBOutlet NSSegmentedControl *historySegmentedControl;
//- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
-- (BOOL) openFiles:(NSURL*) momFile :(NSURL*) perstenceFile: (NSInteger) persistenceType;
+- (BOOL) openFiles:(NSURL*) momFile persistenceFile:(NSURL*) persistenceFile persistenceType: (NSInteger) persistenceType;
- (NSURL*) momFileUrl;
- (NSURL*) persistenceFileUrl;
View
38 CoreDataUtil/MFLMainWindowController.m
@@ -299,7 +299,7 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
- (id)getValueObjFromDataRows:(NSTableView *)tableView :(NSInteger)row :(NSTableColumn *)tableColumn
{
NSArray* dataRow;
- NSInteger normalizedRow = [self sortOrderedRow:tableView :row];
+ NSInteger normalizedRow = [self sortOrderedRow:tableView row:row];
id valueObj = nil;
@try
@@ -319,7 +319,7 @@ - (id)getValueObjFromDataRows:(NSTableView *)tableView :(NSInteger)row :(NSTable
return valueObj;
}
-- (NSInteger) sortOrderedRow:(NSTableView *)tableView: (NSInteger) row {
+- (NSInteger) sortOrderedRow:(NSTableView *)tableView row:(NSInteger) row {
NSInteger normalizedRow = row;
if (self.sortType == Descending)
{
@@ -351,20 +351,20 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
if (valueObj == nil)
{
- MFLTextTableCellView* textCell = [MFLCellBuilder nullCell:tableView: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder nullCell:tableView owner:self];
return textCell;
}
else if ([valueObj isKindOfClass:[NSString class]])
{
NSString* cellText = [NSString stringWithFormat:@"%@", valueObj];
- MFLTextTableCellView* textCell = [MFLCellBuilder textCellWithString:tableView :cellText: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder textCellWithString:tableView textToSet:cellText owner:self];
return textCell;
}
else if ([valueObj isKindOfClass:[NSURL class]])
{
NSURL* url = (NSURL*) valueObj;
NSString* cellText = [NSString stringWithFormat:@"%@", [url absoluteString]];
- MFLTextTableCellView* textCell = [MFLCellBuilder textCellWithString:tableView :cellText: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder textCellWithString:tableView textToSet:cellText owner:self];
return textCell;
}
else if ([valueObj isKindOfClass:[NSDate class]])
@@ -373,20 +373,20 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
[dateFormatter setDateStyle:self.dateStyle];
[dateFormatter setTimeStyle:self.dateStyle];
NSString *cellText = [dateFormatter stringFromDate:valueObj];
- MFLTextTableCellView* textCell = [MFLCellBuilder textCellWithString:tableView :cellText: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder textCellWithString:tableView textToSet:cellText owner:self];
return textCell;
}
else if ([valueObj isKindOfClass:[NSData class]])
{
NSString* cellText = [NSString stringWithFormat:@"%ld", [valueObj length]];
- MFLTextTableCellView* textCell = [MFLCellBuilder numberCellWithString:tableView :cellText: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder numberCellWithString:tableView textToSet:cellText owner: self];
return textCell;
}
else if ([valueObj isKindOfClass:[NSNumber class]])
{
NSString* cellText = [NSString stringWithFormat:@"%@", valueObj];
- MFLTextTableCellView* textCell = [MFLCellBuilder numberCellWithString:tableView :cellText: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder numberCellWithString:tableView textToSet:cellText owner:self];
return textCell;
}
@@ -394,7 +394,7 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
else if ([valueObj isKindOfClass:[NSManagedObject class]])
{
NSString* cellText = [NSString stringWithFormat:@"%@", [[valueObj entity] name]];
- MFLButtonTableViewCell* buttonCell = [MFLCellBuilder objectCellWithString:tableView :cellText: self];
+ MFLButtonTableViewCell* buttonCell = [MFLCellBuilder objectCellWithString:tableView textToSet:cellText owner:self];
return buttonCell;
}
else if ([valueObj isKindOfClass:[NSSet class]])
@@ -412,7 +412,7 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
}
else // Empty NSSet
{
- MFLTextTableCellView* textCell = [MFLCellBuilder nullCell:tableView: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder nullCell:tableView owner:self];
return textCell;
}
}
@@ -431,7 +431,7 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
}
else // Empty NSArray
{
- MFLTextTableCellView* textCell = [MFLCellBuilder nullCell:tableView: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder nullCell:tableView owner:self];
return textCell;
}
}
@@ -442,7 +442,7 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
NSLog(@"is Other");
NSString* cellText = [NSString stringWithFormat:@"??? %@ ???", [valueObj class]];
- MFLTextTableCellView* textCell = [MFLCellBuilder numberCellWithString:tableView :cellText: self];
+ MFLTextTableCellView* textCell = [MFLCellBuilder numberCellWithString:tableView textToSet:cellText owner:self];
[[textCell infoField] setTextColor:[NSColor redColor]];
return textCell;
@@ -455,11 +455,11 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
#pragma mark -
#pragma mark Helpers
-- (BOOL) openFiles:(NSURL*) momFile :(NSURL*) perstenceFile: (NSInteger) persistenceType
+- (BOOL) openFiles:(NSURL*) momFile persistenceFile:(NSURL*) persistenceFile persistenceType:(NSInteger) persistenceType
{
[self.window makeKeyAndOrderFront:self];
- [self openCoreDataIntrospectionWithUrls:momFile :perstenceFile :persistenceType];
+ [self openCoreDataIntrospectionWithUrls:momFile persistFileUrl:persistenceFile persistFormat:persistenceType];
[self.dataSourceList reloadData];
[self.entityContentTable reloadData];
[self enableDisableHistorySegmentedControls];
@@ -467,7 +467,7 @@ - (BOOL) openFiles:(NSURL*) momFile :(NSURL*) perstenceFile: (NSInteger) persist
return YES;
}
-- (void) openCoreDataIntrospectionWithUrls: (NSURL*) momFileUrl: (NSURL*) persistFileUrl: (NSInteger) persistFormat {
+- (void) openCoreDataIntrospectionWithUrls: (NSURL*) momFileUrl persistFileUrl:(NSURL*) persistFileUrl persistFormat:(NSInteger) persistFormat {
[self setCoreDataIntrospection:[[MFLCoreDataIntrospection alloc] init]];
[self.coreDataIntrospection setDateStyle:self.dateStyle];
[self.coreDataIntrospection setDelegate:self];
@@ -596,13 +596,13 @@ - (void)reloadEntityDataTable:(NSString *)name :(NSPredicate *)predicate
self.sortType = Unsorted;
- [self.coreDataIntrospection applyPredicate:name :predicate];
+ [self.coreDataIntrospection applyPredicate:name predicate:predicate];
NSArray* columnNames = [self.coreDataIntrospection entityFieldNames:name];
for (NSString* columnName in columnNames)
{
[self addTableColumnWithIdentifier:columnName];
}
- [self.coreDataIntrospection applyPredicate:name :predicate];
+ [self.coreDataIntrospection applyPredicate:name predicate:predicate];
[self.entityContentTable reloadData];
[self.dataSourceList deselectRow:[self.dataSourceList selectedRow]];
@@ -814,7 +814,7 @@ - (IBAction)closePredicateSheet:(id)sender
- (IBAction)cancelPredicateEditing:(id)sender
{
- [self.coreDataIntrospection applyPredicate:[[self getEntityForPredicateEditor] name] :nil];
+ [self.coreDataIntrospection applyPredicate:[[self getEntityForPredicateEditor] name] predicate:nil];
[self.entityContentTable reloadData];
@@ -825,7 +825,7 @@ - (IBAction)cancelPredicateEditing:(id)sender
- (IBAction)applyPredicate:(id)sender
{
[self.generatedPredicateLabel setStringValue:[self.predicateEditor objectValue]];
- [self.coreDataIntrospection applyPredicate:[[self getEntityForPredicateEditor] name] :[self.predicateEditor objectValue]];
+ [self.coreDataIntrospection applyPredicate:[[self getEntityForPredicateEditor] name] predicate:[self.predicateEditor objectValue]];
[self.entityContentTable reloadData];
}
View
68 CoreDataUtil/OpenFileSheetController.m
@@ -16,7 +16,7 @@ @interface OpenFileSheetController ()
@property (strong) NSDictionary *initialValues;
@property (strong) NSURL *momFileUrl;
@property (strong) NSURL *dbFileUrl;
-@property (strong) NSMutableDictionary *savedFields;
+@property (strong) NSDictionary *savedFields;
@property (strong) NSArray *processList;
@property (strong) NSMutableArray *simulatorUrlList;
@@ -27,7 +27,7 @@ - (void)showOrHideSimulatorButton:(NSButton *)simulatorButton;
- (void)showOrHidePersistenceButtons;
- (NSSet *)filesWithExtension:(NSString *)dir :(NSString *)extension;
- (void)handleMomSelection:(NSSet *)momFiles modelTextField:(NSTextField *)modelTextField;
-- (void)selectDbFileButtonAction:(NSTextField *)modelTextField persistenceTextField:(NSTextField *)persistenceTextField: (NSURL*) directoryURL;
+- (void)selectDbFileButtonAction:(NSTextField *)modelTextField persistenceTextField:(NSTextField *)persistenceTextField directoryURL:(NSURL*) directoryURL;
- (void)selectSimulatorDirectoryAction:(NSTextField *)modelTextField persistenceTextField:(NSTextField *)persistenceTextField;
- (void)clearComboSelector;
@@ -99,7 +99,7 @@ - (void)windowDidLoad
if (self.initialValues != nil)
{
- NSString* momFile = [self.initialValues objectForKey:MFL_MOM_FILE_KEY];
+ NSString* momFile = (self.initialValues)[MFL_MOM_FILE_KEY];
if (momFile != nil) {
if ([[momFile lowercaseString] rangeOfString:@"/iphone simulator"].location != NSNotFound) {
currentTab = SimulatorTab;
@@ -364,7 +364,7 @@ - (void)handleMomSelection:(NSSet *)momFiles modelTextField:(NSTextField *)model
}
}
-- (void)selectDbFileButtonAction:(NSTextField *)modelTextField persistenceTextField:(NSTextField *)persistenceTextField: (NSURL*) directoryURL
+- (void)selectDbFileButtonAction:(NSTextField *)modelTextField persistenceTextField:(NSTextField *)persistenceTextField directoryURL:(NSURL*) directoryURL
{
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
if (directoryURL != nil) {
@@ -377,18 +377,18 @@ - (void)selectDbFileButtonAction:(NSTextField *)modelTextField persistenceTextFi
if ([openDlg runModal] == NSOKButton)
{
- NSString *fileString = [[[openDlg URLs] objectAtIndex:0] absoluteString];
+ NSString *fileString = [[openDlg URLs][0] absoluteString];
if ([fileString hasSuffix:MFL_COREDATA_PROJECT_EXTENSION])
{
- NSDictionary *filePaths = [[NSDictionary alloc] initWithContentsOfURL:[[openDlg URLs] objectAtIndex:0]];
- self.momFileUrl = [NSURL URLWithString:[filePaths objectForKey:MFL_MOM_FILE_KEY]];
+ NSDictionary *filePaths = [[NSDictionary alloc] initWithContentsOfURL:[openDlg URLs][0]];
+ self.momFileUrl = [NSURL URLWithString:filePaths[MFL_MOM_FILE_KEY]];
[modelTextField setStringValue:[self.momFileUrl relativePath]];
- self.dbFileUrl = [NSURL URLWithString:[filePaths objectForKey:MFL_DB_FILE_KEY]];
+ self.dbFileUrl = [NSURL URLWithString:filePaths[MFL_DB_FILE_KEY]];
[persistenceTextField setStringValue:[self.dbFileUrl relativePath]];
}
else
{
- self.dbFileUrl = [[openDlg URLs] objectAtIndex:0];
+ self.dbFileUrl = [openDlg URLs][0];
[persistenceTextField setStringValue:[self.dbFileUrl relativePath]];
}
@@ -433,7 +433,7 @@ - (void)selectSimulatorDirectoryAction:(NSTextField *)modelTextField persistence
[openDlg setCanChooseFiles:YES];
if ([openDlg runModal] == NSOKButton)
{
- self.dbFileUrl = [[openDlg URLs] objectAtIndex:0];
+ self.dbFileUrl = [openDlg URLs][0];
[persistenceTextField setStringValue:[self.dbFileUrl relativePath]];
[self showOrHideOpenButton];
@@ -442,7 +442,7 @@ - (void)selectSimulatorDirectoryAction:(NSTextField *)modelTextField persistence
- (IBAction)fileTabModelFileButtonAction:(id)sender
{
- NSArray *fileTypes = [[NSArray alloc] initWithObjects:@"mom", @"MOM", @"app", MFL_COREDATA_PROJECT_EXTENSION, MFL_COREDATA_PROJECT_EXTENSION_UPERCASE, MFL_COREDATA_EDITOR_PROJECT_EXTENSION, nil];
+ NSArray *fileTypes = @[@"mom", @"MOM", @"app", MFL_COREDATA_PROJECT_EXTENSION, MFL_COREDATA_PROJECT_EXTENSION_UPERCASE, MFL_COREDATA_EDITOR_PROJECT_EXTENSION];
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
[openDlg setTreatsFilePackagesAsDirectories:NO];
@@ -451,13 +451,13 @@ - (IBAction)fileTabModelFileButtonAction:(id)sender
if ([openDlg runModal] == NSOKButton)
{
- NSString *fileString = [[[openDlg URLs] objectAtIndex:0] absoluteString];
+ NSString *fileString = [[openDlg URLs][0] absoluteString];
if ([fileString hasSuffix:MFL_COREDATA_PROJECT_EXTENSION])
{
- NSDictionary *filePaths = [[NSDictionary alloc] initWithContentsOfURL:[[openDlg URLs] objectAtIndex:0]];
- self.momFileUrl = [NSURL URLWithString:[filePaths objectForKey:MFL_MOM_FILE_KEY]];
+ NSDictionary *filePaths = [[NSDictionary alloc] initWithContentsOfURL:[openDlg URLs][0]];
+ self.momFileUrl = [NSURL URLWithString:filePaths[MFL_MOM_FILE_KEY]];
[self.fileTabModelTextField setStringValue:[self.momFileUrl relativePath]];
- self.dbFileUrl = [NSURL URLWithString:[filePaths objectForKey:MFL_DB_FILE_KEY]];
+ self.dbFileUrl = [NSURL URLWithString:filePaths[MFL_DB_FILE_KEY]];
[self.fileTabPersistenceTextField setStringValue:[self.dbFileUrl relativePath]];
[self showOrHideOpenButton];
@@ -465,13 +465,13 @@ - (IBAction)fileTabModelFileButtonAction:(id)sender
}
else if ([fileString hasSuffix:@".app"])
{
- NSURL *url = [[openDlg URLs] objectAtIndex:0];
+ NSURL *url = [openDlg URLs][0];
NSSet *momFiles = [self filesWithExtension: [url path]: MFL_MOM_FILE_EXTENSION];
[self handleMomSelection:momFiles modelTextField:self.fileTabModelTextField];
}
else
{
- self.momFileUrl = [[openDlg URLs] objectAtIndex:0];
+ self.momFileUrl = [openDlg URLs][0];
[self.fileTabModelTextField setStringValue:[self.momFileUrl relativePath]];
[self showOrHideOpenButton];
@@ -498,7 +498,7 @@ - (IBAction)processTabRunningProcessButtonAction:(id)sender
[apps sortUsingSelector:@selector(caseInsensitiveCompare:)];
// update self.processList
NSSortDescriptor *desc = [NSSortDescriptor sortDescriptorWithKey:@"localizedName" ascending:YES selector:@selector(caseInsensitiveCompare:)];
- self.processList = [self.processList sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]];
+ self.processList = [self.processList sortedArrayUsingDescriptors:@[desc]];
[self.processSelectorBox addItemsWithObjectValues:apps];
@@ -551,7 +551,7 @@ - (IBAction)simulatorTabSimulatorAppButtonAction:(id)sender
}
}
- [apps addObject:[NSString stringWithFormat:@"%@ %@ %@", [separatedPath objectAtIndex:versionIndex], appName, [separatedPath objectAtIndex:[separatedPath count]-1]]];
+ [apps addObject:[NSString stringWithFormat:@"%@ %@ %@", separatedPath[versionIndex], appName, separatedPath[[separatedPath count]-1]]];
}
[self.processSelectorBox addItemsWithObjectValues:apps];
@@ -566,13 +566,13 @@ - (IBAction)simulatorTabSimulatorAppButtonAction:(id)sender
- (IBAction)tabStoreFileButtonAction:(id)sender
{
NSTextField* storeTextField = [self currentPersistenceTextField];
- [self selectDbFileButtonAction:self.simulatorTabModelTextField persistenceTextField:storeTextField: nil];
+ [self selectDbFileButtonAction:self.simulatorTabModelTextField persistenceTextField:storeTextField directoryURL:nil];
}
- (IBAction)tabStoreApplicationSupportButtonAction:(id)sender
{
NSTextField* storeTextField = [self currentPersistenceTextField];
- [self selectDbFileButtonAction:self.simulatorTabModelTextField persistenceTextField:storeTextField: [self applicationSupportDirectory] ];
+ [self selectDbFileButtonAction:self.simulatorTabModelTextField persistenceTextField:storeTextField directoryURL:[self applicationSupportDirectory] ];
}
- (IBAction)openButtonAction:(id)sender
@@ -603,7 +603,7 @@ - (IBAction)comboSelectOk:(id)sender
{
if (self.processList != nil)
{
- NSRunningApplication* selectedApp = [self.processList objectAtIndex:selectedItemIndex];
+ NSRunningApplication* selectedApp = (self.processList)[selectedItemIndex];
NSLog(@"Selected: %@", selectedApp);
NSSet* momFiles = [self filesWithExtension: [[selectedApp bundleURL] path]: MFL_MOM_FILE_EXTENSION];
@@ -629,17 +629,17 @@ - (IBAction)comboSelectOk:(id)sender
{
NSLog(@"value: %@ - %@", [self.processSelectorBox objectValueOfSelectedItem], [[self.processSelectorBox objectValueOfSelectedItem] class]);
- self.momFileUrl = [NSURL fileURLWithPath:[self.simulatorUrlList objectAtIndex:selectedItemIndex]];
+ self.momFileUrl = [NSURL fileURLWithPath:(self.simulatorUrlList)[selectedItemIndex]];
switch (currentTab)
{
case FileTab:
- [self.fileTabModelTextField setStringValue:[self.simulatorUrlList objectAtIndex:selectedItemIndex]];
+ [self.fileTabModelTextField setStringValue:(self.simulatorUrlList)[selectedItemIndex]];
break;
case ProcessTab:
- [self.processTabModelTextField setStringValue:[self.simulatorUrlList objectAtIndex:selectedItemIndex]];
+ [self.processTabModelTextField setStringValue:(self.simulatorUrlList)[selectedItemIndex]];
break;
case SimulatorTab:
- [self.simulatorTabModelTextField setStringValue:[self.simulatorUrlList objectAtIndex:selectedItemIndex]];
+ [self.simulatorTabModelTextField setStringValue:(self.simulatorUrlList)[selectedItemIndex]];
break;
}
@@ -672,9 +672,9 @@ - (NSDictionary *)show:(NSWindow *)sender :(NSDictionary *)initialValues
[self setInitialValues:initialValues];
[self initializeTab];
- if (self.initialValues != nil && [self.initialValues objectForKey:MFL_MOM_FILE_KEY] != nil)
+ if (self.initialValues != nil && (self.initialValues)[MFL_MOM_FILE_KEY] != nil)
{
- NSString* momFilePath = [self.initialValues objectForKey:MFL_MOM_FILE_KEY];
+ NSString* momFilePath = (self.initialValues)[MFL_MOM_FILE_KEY];
self.momFileUrl = [NSURL fileURLWithPath:momFilePath];
if ([[momFilePath lowercaseString] rangeOfString:@"/iphone simulator"].location != NSNotFound) {
@@ -702,9 +702,9 @@ - (NSDictionary *)show:(NSWindow *)sender :(NSDictionary *)initialValues
}
}
- if (self.initialValues != nil && [self.initialValues objectForKey:MFL_DB_FILE_KEY] != nil)
+ if (self.initialValues != nil && (self.initialValues)[MFL_DB_FILE_KEY] != nil)
{
- NSString* storeFilePath = [self.initialValues objectForKey:MFL_DB_FILE_KEY];
+ NSString* storeFilePath = (self.initialValues)[MFL_DB_FILE_KEY];
self.dbFileUrl = [NSURL fileURLWithPath:storeFilePath];
NSTextField* textField = [self currentPersistenceTextField];
@@ -723,11 +723,9 @@ - (NSDictionary *)show:(NSWindow *)sender :(NSDictionary *)initialValues
if (didSubmit)
{
- self.savedFields = [NSDictionary dictionaryWithObjectsAndKeys:
- self.momFileUrl, MFL_MOM_FILE_KEY,
- self.dbFileUrl, MFL_DB_FILE_KEY,
- [NSNumber numberWithInt:[self persistFileFormat]], MFL_DB_FORMAT_KEY,
- nil];
+ self.savedFields = @{MFL_MOM_FILE_KEY: self.momFileUrl,
+ MFL_DB_FILE_KEY: self.dbFileUrl,
+ MFL_DB_FORMAT_KEY: [NSNumber numberWithInt:[self persistFileFormat]]};
}
else
{
View
10 CoreDataUtil/Utils/MFLCoreDataEditorProjectLoader.m
@@ -12,15 +12,15 @@
@implementation MFLCoreDataEditorProjectLoader
-- (NSFetchRequest*) fetchRequestForEntitiesOfType: (NSManagedObjectContext*) managedObjectContext: (NSString*) entityName {
+- (NSFetchRequest*) fetchRequestForEntitiesOfType:(NSManagedObjectContext*) managedObjectContext entityName:(NSString*) entityName {
NSFetchRequest* fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:managedObjectContext]];
return fetchRequest;
}
-- (NSArray*) executeFetchRequest: (NSManagedObjectContext*) managedObjectContext: (NSFetchRequest*) fetchRequest {
+- (NSArray*) executeFetchRequest:(NSManagedObjectContext*) managedObjectContext fetchRequest:(NSFetchRequest*) fetchRequest {
NSError* error = nil;
- NSArray* results = [managedObjectContext executeFetchRequest:fetchRequest error:&error];
+ NSArray* results = [managedObjectContext executeFetchRequest :fetchRequest error:&error];
if (error != nil) {
@throw [NSException exceptionWithName:@"Could not execute fetch request." reason:[NSString stringWithFormat:@"Trouble executing fetch request %@: %@", fetchRequest, error] userInfo:nil];
}
@@ -48,8 +48,8 @@ - (NSDictionary*) decodeProjectFile: (NSString*) projectFilePath {
NSManagedObjectContext* managedObjectContext = [[NSManagedObjectContext alloc] init];
[managedObjectContext setPersistentStoreCoordinator:coordinator];
- NSFetchRequest* fetchRequest = [self fetchRequestForEntitiesOfType:managedObjectContext :@"CDEConfiguration"];
- NSArray* results = [self executeFetchRequest:managedObjectContext :fetchRequest];
+ NSFetchRequest* fetchRequest = [self fetchRequestForEntitiesOfType:managedObjectContext entityName:@"CDEConfiguration"];
+ NSArray* results = [self executeFetchRequest:managedObjectContext fetchRequest:fetchRequest];
if (results != nil && [results count] > 0) {
NSManagedObject* object = results[0];
Please sign in to comment.
Something went wrong with that request. Please try again.