HappyHarpreet
HappyHarpreet

Reputation: 65

Xcode 6 Beta 5 error - use of unresolved identifier '..'

I dont know why I'm getting this error? I am using Xcode 6 beta 5

func random() ->UInt32 {
    var range = UInt32(50)..UInt32(200)
    return range.startIndex + arc4random_uniform(range.endIndex - range.startIndex + 1)

I get the error - use of unresolved identifier '..'

Please help, thank you

Upvotes: 1

Views: 1333

Answers (1)

BJ Homer
BJ Homer

Reputation: 49034

In beta 3, the half-closed range operator was changed from .. to ..<. So your second line should be this instead:

var range = UInt32(50)..<UInt32(200)

Upvotes: 5

Related Questions