6

I'm trying to use arc4random_uniform in the Xcode build mentioned, but it seems to no longer be available:

arc4random_uniform no longer available

An alt-click on the available functions show that they're declared in stdlib.h, which has them listed as follows:

stdlib.h showing arc4random_uniform defined

It seems strange that its no longer available. This particular stdlib.h is within the iOS 9.0 simulator directory at usr/include/stdlib.h not sure if that helps or not.

I have the latest command line tools installed. Not sure what's going on. Any advice / help / fixes are much appreciated. Thanks in advance.

UPDATE

Seems to be an Xcode bug, references for which are:

  • 22275032
  • 22275176
halfer
  • 19,824
  • 17
  • 99
  • 186
Kyle G
  • 4,347
  • 4
  • 26
  • 39

1 Answers1

5

It seems to be still available (I have been using it in 7A176x, but on El Capitan), it is just not shown in the suggestions.

MirekE
  • 11,515
  • 5
  • 35
  • 28
  • Yeah, I loaded a different project that had it in there already and that didn't raise any issues. Like you said, seems to work, just not in autocomplete. Thanks for taking the time to check. – Kyle G Aug 13 '15 at 20:36
  • @KyleGillen: It looks like a problem in the auto-generated Swift headers (where it also does not appear), so you could file a bug report. – Martin R Aug 13 '15 at 20:37
  • @MartinR will do. Thanks for taking a look. – Kyle G Aug 13 '15 at 20:41
  • Actually `arc4random()` is also missing. I assume a problem with the `u_int32_t` type. – Martin R Aug 13 '15 at 20:42
  • @MartinR &KyleGillen If you have time to file a bug, feel free to reference my 22275032. – MirekE Aug 13 '15 at 20:44
  • @MirekE brilliant. Done 22275176 – Kyle G Aug 13 '15 at 20:52