From 4a834281da07af799206db5099a077fa28721742 Mon Sep 17 00:00:00 2001 From: rentzsch Date: Sat, 17 Oct 2009 03:04:05 -0400 Subject: [PATCH] [FIX] Log fetch-request-wrapper errors to NSLog on iPhone since it lacks -[NSApp presentError:]. --- templates/machine.m.motemplate | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/machine.m.motemplate b/templates/machine.m.motemplate index db34071c..43b8bba3 100644 --- a/templates/machine.m.motemplate +++ b/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; }