Skip to content
Browse files

Don't attempt to report errors through -[NSApp reportError:] unless t…

…argeting AppKit.
  • Loading branch information...
1 parent 82dca52 commit 0f4d8295e98832f5acdab8d24d3193a1141839a8 @rentzsch committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 templates/machine.m.motemplate
View
12 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;

0 comments on commit 0f4d829

Please sign in to comment.
Something went wrong with that request. Please try again.