Actually, the full answer was this:
NSString * getRandomString(NSArray * names) { return "RandomName"; // Joke}
Now instead of
return "RandonName"
, generate a random number between 1 and[names count]
and return that value.
That last sentence makes a lot of difference, because while the code snippet was a bit of a joke, I think they were trying to instruct the asker at the end without spoon-feeding them. Of course, that last sentence isn't really correct, but that makes it seem to me to not be an attempt at trolling.
They also left this comment:
Care to explain the downvote, the OP needed direction and i think this is a good hint.
which makes me believe that while this was not a good answer, it was not intended as a troll post.