Skip to content

Commit b317ac2

Browse files
author
MeXx
committed
Replaced [results objectAtIndex:0] with results.firstObject
1 parent 7b4d9fa commit b317ac2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

templates/machine.m.motemplate

+4
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ const struct <$managedObjectClassName$>UserInfo <$managedObjectClassName$>UserIn
164164
// Nothing found matching the fetch request. That's cool, though: we'll just return nil.
165165
break;
166166
case 1:
167+
<$if TemplateVar.literals$>
168+
result = results.firstObject;
169+
<$else$>
167170
result = [results objectAtIndex:0];
171+
<$endif$>
168172
break;
169173
default:
170174
NSLog(@"WARN fetch request <$FetchRequest.name$>: 0 or 1 objects expected, %lu found (substitutionVariables:%@, results:%@)",

0 commit comments

Comments
 (0)