Permalink
Browse files

[FIX] Log fetch-request-wrapper errors to NSLog on iPhone since it la…

…cks -[NSApp presentError:].
  • Loading branch information...
1 parent 5ff2039 commit 4a834281da07af799206db5099a077fa28721742 @rentzsch committed Oct 17, 2009
Showing with 8 additions and 0 deletions.
  1. +8 −0 templates/machine.m.motemplate
@@ -86,7 +86,11 @@
NSError *error = nil;
id result = [self fetch<$FetchRequest.name.initialCapitalString$>:moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:<$Binding.name$>_<$endforeach do2$> error:&error];
if (error) {
+#if TARGET_OS_IPHONE
+ NSLog(@"error: %@", error);
+#else
[NSApp presentError:error];
+#endif
}
return result;
}
@@ -130,7 +134,11 @@
NSError *error = nil;
NSArray *result = [self fetch<$FetchRequest.name.initialCapitalString$>:moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:<$Binding.name$>_<$endforeach do2$> error:&error];
if (error) {
+#if TARGET_OS_IPHONE
+ NSLog(@"error: %@", error);
+#else
[NSApp presentError:error];
+#endif
}
return result;
}

0 comments on commit 4a83428

Please sign in to comment.