Skip to content

Commit

Permalink
Don't attempt to report errors through -[NSApp reportError:] unless t…
Browse files Browse the repository at this point in the history
…argeting AppKit.
  • Loading branch information
rentzsch committed Aug 31, 2012
1 parent 82dca52 commit 0f4d829
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions templates/machine.m.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0f4d829

Please sign in to comment.