Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Please help! I have an error in xcode!

import Foundation

var randomTemperature = Int
(arc4random_uniform(UInt32(150)))

This is the code that Pasan gave us and it shows an error.

1 Answer

Hey there!

I think this might be what you are up to:

var randomTemperature = Int(arc4random_uniform(UInt32(150)))

// This should work as well:
var randomTemperature = Int(arc4random_uniform(150))

I think you just introduced a line break by mistake :)

Hope that helps :)

Yeah, thanks. But Pasan wrote it on two lines and I don't understand why I get an error. Yours works too so thanks!