Skip to content

Commit

Permalink
Replaced [results objectAtIndex:0] with results.firstObject
Browse files Browse the repository at this point in the history
  • Loading branch information
MeXx committed Aug 26, 2015
1 parent 7b4d9fa commit b317ac2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/machine.m.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -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:%@)",
Expand Down

0 comments on commit b317ac2

Please sign in to comment.