From 0f4d8295e98832f5acdab8d24d3193a1141839a8 Mon Sep 17 00:00:00 2001 From: rentzsch Date: Thu, 30 Aug 2012 21:39:16 -0500 Subject: [PATCH] Don't attempt to report errors through -[NSApp reportError:] unless targeting AppKit. --- templates/machine.m.motemplate | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/machine.m.motemplate b/templates/machine.m.motemplate index 5995466e..a4ddc399 100644 --- a/templates/machine.m.motemplate +++ b/templates/machine.m.motemplate @@ -105,10 +105,10 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam 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 +#ifdef NSAppKitVersionNumber10_0 [NSApp presentError:error]; +#else + NSLog(@"error: %@", error); #endif } return result; @@ -158,10 +158,10 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam 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 +#ifdef NSAppKitVersionNumber10_0 [NSApp presentError:error]; +#else + NSLog(@"error: %@", error); #endif } return result;