This is the simplest solution I could come up with:
id object = array.count == 0 ? nil : array[arc4random_uniform(array.count)];
It's necessary to check count because a non-nil but empty NSArray will return 0 for count, and arc4random_uniform(0) returns 0. So without the check, you'll go out of bounds on the array.
This solution is tempting but is wrong because it will cause a crash with an empty array:
id object = array[arc4random_uniform(array.count)];
if you want to cast that to an int, here's the solution for that (useful for when you need a random int from an array of non-sequential numbers, in the case of randomizing an enum call, etc)
int intVarName = (int)[(NSNumber *)[array objectAtIndex:arc4random_uniform((int)(array.count - 1))] integerValue];