Skip to content

Commit

Permalink
Merge pull request #59 from mutualmobile/cnstoll_coreDataErrorHandling
Browse files Browse the repository at this point in the history
Reworking core data error handling
  • Loading branch information
cnstoll committed Jun 25, 2014
2 parents 634a11a + cdc706f commit 1c16165
Show file tree
Hide file tree
Showing 20 changed files with 737 additions and 352 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
262496B816D9E45000767D83 /* MMRecordCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 262496B716D9E45000767D83 /* MMRecordCache.m */; };
2648FBEA195B0861009A6CBB /* MMRecordDebugger.m in Sources */ = {isa = PBXBuildFile; fileRef = 2648FBE8195AFC5B009A6CBB /* MMRecordDebugger.m */; };
267469E516A1C128006A6A81 /* MMRecordResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 267469E416A1C128006A6A81 /* MMRecordResponse.m */; };
267469EC16A1C226006A6A81 /* MMRecordProtoRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 267469EB16A1C226006A6A81 /* MMRecordProtoRecord.m */; };
2690DDEE16DAE38A00FE31AC /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2690DDED16DAE38A00FE31AC /* MobileCoreServices.framework */; };
Expand Down Expand Up @@ -95,6 +96,8 @@
/* Begin PBXFileReference section */
262496B616D9E45000767D83 /* MMRecordCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordCache.h; sourceTree = "<group>"; };
262496B716D9E45000767D83 /* MMRecordCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordCache.m; sourceTree = "<group>"; };
2648FBE7195AFC5B009A6CBB /* MMRecordDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordDebugger.h; sourceTree = "<group>"; };
2648FBE8195AFC5B009A6CBB /* MMRecordDebugger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordDebugger.m; sourceTree = "<group>"; };
267469E316A1C128006A6A81 /* MMRecordResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordResponse.h; sourceTree = "<group>"; };
267469E416A1C128006A6A81 /* MMRecordResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordResponse.m; sourceTree = "<group>"; };
267469EA16A1C226006A6A81 /* MMRecordProtoRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordProtoRecord.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -192,7 +195,6 @@
55F951FB165C73460060851E /* ADNPostsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ADNPostsViewController.m; sourceTree = "<group>"; };
55F9520B165C741E0060851E /* MMRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecord.h; sourceTree = "<group>"; };
55F9520C165C741E0060851E /* MMRecord.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecord.m; sourceTree = "<group>"; };
55F9520E165C741E0060851E /* MMRecordErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordErrors.h; sourceTree = "<group>"; };
55F9520F165C741E0060851E /* MMServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMServer.h; sourceTree = "<group>"; };
55F95210165C741E0060851E /* MMServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMServer.m; sourceTree = "<group>"; };
55F95211165C741E0060851E /* MMServerPageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMServerPageManager.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -478,7 +480,8 @@
55F9520C165C741E0060851E /* MMRecord.m */,
262496B616D9E45000767D83 /* MMRecordCache.h */,
262496B716D9E45000767D83 /* MMRecordCache.m */,
55F9520E165C741E0060851E /* MMRecordErrors.h */,
2648FBE7195AFC5B009A6CBB /* MMRecordDebugger.h */,
2648FBE8195AFC5B009A6CBB /* MMRecordDebugger.m */,
5569077916FA750D0040D191 /* MMRecordMarshaler.h */,
5569077A16FA750D0040D191 /* MMRecordMarshaler.m */,
267469EA16A1C226006A6A81 /* MMRecordProtoRecord.h */,
Expand Down Expand Up @@ -658,6 +661,7 @@
55F95227165C76370060851E /* Post.m in Sources */,
55F9522A165C76920060851E /* ADNRecord.m in Sources */,
55AA517018BF997F00F54E80 /* CoverImage.m in Sources */,
2648FBEA195B0861009A6CBB /* MMRecordDebugger.m in Sources */,
55F95243165C77380060851E /* AFHTTPClient.m in Sources */,
55AA657418FB1F610018B4A0 /* FBTweakInline.m in Sources */,
55F95244165C77380060851E /* AFHTTPRequestOperation.m in Sources */,
Expand Down
12 changes: 7 additions & 5 deletions Examples/MMRecordAppDotNet/MMRecordAppDotNet/MMAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
@implementation MMAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//[ADNServer registerAFHTTPClient:[ADNHTTPClient sharedClient]];
//[ADNRecord registerServerClass:[ADNServer class]];
[ADNServer registerAFHTTPClient:[ADNHTTPClient sharedClient]];
[ADNRecord registerServerClass:[ADNServer class]];

[FBMMRecordTweakModel loadTweaksForManagedObjectModel:[MMDataManager sharedDataManager].managedObjectModel];
#define FBMMRecordTweakModelDefine

[MMJSONServer registerResourceName:@"posts" forPathComponent:@"posts"];
[ADNRecord registerServerClass:[MMJSONServer class]];
// You can uncomment the below methods to enable the MMJSONServer for this example project
// [MMJSONServer registerResourceName:@"posts" forPathComponent:@"posts"];
// [ADNRecord registerServerClass:[MMJSONServer class]];

//[MMRecord setLoggingLevel:MMRecordLoggingLevelDebug];
// You can uncomment the below line to enable logging for this example project
// [MMRecord setLoggingLevel:MMRecordLoggingLevelDebug];

return YES;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
26ECD8A8195B3E8800DBB3C5 /* MMRecordDebugger.m in Sources */ = {isa = PBXBuildFile; fileRef = 26ECD8A7195B3E8800DBB3C5 /* MMRecordDebugger.m */; };
26F9870918666C03000CAF96 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 26F9870518666C03000CAF96 /* Main.storyboard */; };
26F9870A18666C03000CAF96 /* MMViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 26F9870818666C03000CAF96 /* MMViewController.m */; };
26F9870D18667076000CAF96 /* MMVenueViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 26F9870C18667076000CAF96 /* MMVenueViewController.m */; };
Expand Down Expand Up @@ -72,6 +73,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
26ECD8A6195B3E8800DBB3C5 /* MMRecordDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordDebugger.h; sourceTree = "<group>"; };
26ECD8A7195B3E8800DBB3C5 /* MMRecordDebugger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordDebugger.m; sourceTree = "<group>"; };
26F9870618666C03000CAF96 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = MMRecordFoursquare/Base.lproj/Main.storyboard; sourceTree = SOURCE_ROOT; };
26F9870718666C03000CAF96 /* MMViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMViewController.h; path = MMRecordFoursquare/MMViewController.h; sourceTree = SOURCE_ROOT; };
26F9870818666C03000CAF96 /* MMViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMViewController.m; path = MMRecordFoursquare/MMViewController.m; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -138,8 +141,6 @@
55D2789218297E01008CB6B4 /* MMRecord.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecord.m; sourceTree = "<group>"; };
55D2789318297E01008CB6B4 /* MMRecordCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordCache.h; sourceTree = "<group>"; };
55D2789418297E01008CB6B4 /* MMRecordCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordCache.m; sourceTree = "<group>"; };
55D2789518297E01008CB6B4 /* MMRecordErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordErrors.h; sourceTree = "<group>"; };
55D2789618297E01008CB6B4 /* MMRecordLoggers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordLoggers.h; sourceTree = "<group>"; };
55D2789718297E01008CB6B4 /* MMRecordMarshaler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordMarshaler.h; sourceTree = "<group>"; };
55D2789818297E01008CB6B4 /* MMRecordMarshaler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordMarshaler.m; sourceTree = "<group>"; };
55D2789918297E01008CB6B4 /* MMRecordProtoRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordProtoRecord.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -389,8 +390,8 @@
55D2789218297E01008CB6B4 /* MMRecord.m */,
55D2789318297E01008CB6B4 /* MMRecordCache.h */,
55D2789418297E01008CB6B4 /* MMRecordCache.m */,
55D2789518297E01008CB6B4 /* MMRecordErrors.h */,
55D2789618297E01008CB6B4 /* MMRecordLoggers.h */,
26ECD8A6195B3E8800DBB3C5 /* MMRecordDebugger.h */,
26ECD8A7195B3E8800DBB3C5 /* MMRecordDebugger.m */,
55D2789718297E01008CB6B4 /* MMRecordMarshaler.h */,
55D2789818297E01008CB6B4 /* MMRecordMarshaler.m */,
55D2789918297E01008CB6B4 /* MMRecordProtoRecord.h */,
Expand Down Expand Up @@ -558,6 +559,7 @@
550DFAA41846AF2300E76A6B /* Menu.m in Sources */,
26F9870A18666C03000CAF96 /* MMViewController.m in Sources */,
55D278AA18297E01008CB6B4 /* MMRecordRepresentation.m in Sources */,
26ECD8A8195B3E8800DBB3C5 /* MMRecordDebugger.m in Sources */,
55FB3C1A18C1A10400B861BA /* AFMMRecordSessionManagerServer.m in Sources */,
55D278B2182980BC008CB6B4 /* FSRecord.m in Sources */,
55D278A618297E01008CB6B4 /* MMRecord.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "55D278061829765E008CB6B4"
BuildableName = "MMRecordFoursquare.app"
BlueprintName = "MMRecordFoursquare"
ReferencedContainer = "container:MMRecordFoursquare.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "55D278061829765E008CB6B4"
BuildableName = "MMRecordFoursquare.app"
BlueprintName = "MMRecordFoursquare"
ReferencedContainer = "container:MMRecordFoursquare.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 = "55D278061829765E008CB6B4"
BuildableName = "MMRecordFoursquare.app"
BlueprintName = "MMRecordFoursquare"
ReferencedContainer = "container:MMRecordFoursquare.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "55D278061829765E008CB6B4"
BuildableName = "MMRecordFoursquare.app"
BlueprintName = "MMRecordFoursquare"
ReferencedContainer = "container:MMRecordFoursquare.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

sessionManager.responseSerializer = serializer;

// You can uncomment the below line to enable logging for this example project
//[MMRecord setLoggingLevel:MMRecordLoggingLevelAll];

return YES;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ - (void)cancel {
[self.lock lock];
if (![self isFinished] && ![self isCancelled]) {
[self willChangeValueForKey:@"isCancelled"];
_cancelled = YES;
self.cancelled = YES;
[super cancel];
[self didChangeValueForKey:@"isCancelled"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
26ECD8AB195B3EA200DBB3C5 /* MMRecordDebugger.m in Sources */ = {isa = PBXBuildFile; fileRef = 26ECD8AA195B3EA200DBB3C5 /* MMRecordDebugger.m */; };
5509C0ED16FE8E6600310806 /* MMInstagramManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5509C0EC16FE8E6600310806 /* MMInstagramManager.m */; };
5509C0F016FE902C00310806 /* MediaCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 5509C0EF16FE902C00310806 /* MediaCell.m */; };
5509C0F216FE903F00310806 /* MediaCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5509C0F116FE903F00310806 /* MediaCell.xib */; };
Expand Down Expand Up @@ -73,6 +74,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
26ECD8A9195B3EA200DBB3C5 /* MMRecordDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordDebugger.h; sourceTree = "<group>"; };
26ECD8AA195B3EA200DBB3C5 /* MMRecordDebugger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordDebugger.m; sourceTree = "<group>"; };
5509C0EB16FE8E6600310806 /* MMInstagramManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMInstagramManager.h; sourceTree = "<group>"; };
5509C0EC16FE8E6600310806 /* MMInstagramManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMInstagramManager.m; sourceTree = "<group>"; };
5509C0EE16FE902C00310806 /* MediaCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaCell.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -130,7 +133,6 @@
9FABD97916FA93EF00184BA5 /* MMRecord.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecord.m; sourceTree = "<group>"; };
9FABD97A16FA93EF00184BA5 /* MMRecordCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordCache.h; sourceTree = "<group>"; };
9FABD97B16FA93EF00184BA5 /* MMRecordCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordCache.m; sourceTree = "<group>"; };
9FABD98216FA93EF00184BA5 /* MMRecordErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordErrors.h; sourceTree = "<group>"; };
9FABD98316FA93EF00184BA5 /* MMRecordMarshaler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordMarshaler.h; sourceTree = "<group>"; };
9FABD98416FA93EF00184BA5 /* MMRecordMarshaler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMRecordMarshaler.m; sourceTree = "<group>"; };
9FABD98816FA93EF00184BA5 /* MMRecordProtoRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMRecordProtoRecord.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -380,7 +382,8 @@
9FABD97916FA93EF00184BA5 /* MMRecord.m */,
9FABD97A16FA93EF00184BA5 /* MMRecordCache.h */,
9FABD97B16FA93EF00184BA5 /* MMRecordCache.m */,
9FABD98216FA93EF00184BA5 /* MMRecordErrors.h */,
26ECD8A9195B3EA200DBB3C5 /* MMRecordDebugger.h */,
26ECD8AA195B3EA200DBB3C5 /* MMRecordDebugger.m */,
9FABD98316FA93EF00184BA5 /* MMRecordMarshaler.h */,
9FABD98416FA93EF00184BA5 /* MMRecordMarshaler.m */,
9FABD98816FA93EF00184BA5 /* MMRecordProtoRecord.h */,
Expand Down Expand Up @@ -565,6 +568,7 @@
9FABD9B816FA966A00184BA5 /* AFHTTPClient.m in Sources */,
9FABD9B916FA966A00184BA5 /* AFHTTPRequestOperation.m in Sources */,
9FABD9BA16FA966A00184BA5 /* AFImageRequestOperation.m in Sources */,
26ECD8AB195B3EA200DBB3C5 /* MMRecordDebugger.m in Sources */,
9FABD9BB16FA966A00184BA5 /* AFJSONRequestOperation.m in Sources */,
9FABD9BC16FA966A00184BA5 /* AFNetworkActivityIndicatorManager.m in Sources */,
9FABD9BD16FA966A00184BA5 /* AFPropertyListRequestOperation.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ @implementation MMAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[MMJSONPerformanceTestingServer setResultSetSize:10000];
[ADNRecord registerServerClass:[MMJSONPerformanceTestingServer class]];

// You can uncomment the below line to enable logging for this example project
//[MMRecord setLoggingLevel:MMRecordLoggingLevelAll];

return YES;
Expand Down
Loading

0 comments on commit 1c16165

Please sign in to comment.