What is the approved method of getting a random number in macOS in Objective C? Presently I'm using:
srandomdev();
randomDevice = fopen("/dev/random", "r");
//
//
//
-(uint64)random64
{
uint64_t value = 0;
int i;
for (i = 0 ; i < sizeof(value); i++)
{
value <<= 8;
value |= fgetc(randomDevice);
}
return value;
}
However, this method no longer appears in the documentation. Is there a more modern implementation?