diff --git a/templates/machine.m.motemplate b/templates/machine.m.motemplate index 7cbf24a1..fdf55e2f 100644 --- a/templates/machine.m.motemplate +++ b/templates/machine.m.motemplate @@ -164,7 +164,11 @@ const struct <$managedObjectClassName$>UserInfo <$managedObjectClassName$>UserIn // Nothing found matching the fetch request. That's cool, though: we'll just return nil. break; case 1: + <$if TemplateVar.literals$> + result = results.firstObject; + <$else$> result = [results objectAtIndex:0]; + <$endif$> break; default: NSLog(@"WARN fetch request <$FetchRequest.name$>: 0 or 1 objects expected, %lu found (substitutionVariables:%@, results:%@)",