Xcode 7 arc4random missing?

I upgraded to Xcode 7 when it was released, but I have not had the opportunity to use it since the upgrade so far. When creating the game, I needed to use arc4random as follows:

let RandomPosNmber = arc4random() % 4

When I tried to add it manually, he continued to give me errors. The only options were:

arc4random_addrandom(UnsafeMutablePointer<UInt8>, Int32)

arc4random_buf(UnsafeMutablePointer<Void>, Int)

arc4random_stir()

Did Apple remove arc4random permanently or temporarily? What would be an alternative to the code above? If more code is needed, I will provide it.

+4
source share
1 answer

, arc4random . . , import UIKit iOS import Cocoa OSX. arc4random_uniform.

let randomPositionNumber = arc4random_uniform(4)

Xcode :

defaults delete com.apple.dt.Xcode 
+3

Source: https://habr.com/ru/post/1612519/


All Articles