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 Swift Basics (retired) Control Flow For-In Loop

Michael Kolkebeck
Michael Kolkebeck
2,878 Points

The for-in loop challenge task does not compile in editor, but does in Xcode

My code...

for number in 1...10 { println("(number) * 7 = (number*7)") }

And I get this error...

swift_lint.swift:5:30: error: 'countElements' has been renamed to count let range = NSMakeRange(0, countElements(string)) ^~~~~~~~~~~~~ count Swift.countElements:1:36: note: 'countElements' has been explicitly marked unavailable here @availability(*, unavailable) func countElements(x: T) -> T.Index.Distance ^

2 Answers

Joe Dayvie
Joe Dayvie
11,956 Points

Hello,

Are you putting the slashes before the (number) in the code? Otherwise it looks good and works for me.

Michael Kolkebeck
Michael Kolkebeck
2,878 Points

Ah, yea, the slashes are there. The formatting of the slashes did not take very well in the forum. I think it's a problem with the backend, since I get the compile error even with a simple var statement.

Joe Dayvie
Joe Dayvie
11,956 Points

Michael,

I would say to refresh and go back to the quiz and see if it will accept your answer then - Sometimes that has happened to me :)

Michael Kolkebeck
Michael Kolkebeck
2,878 Points

A refresh did not work. I also cleared all history and cookies. It seems like someone clobbered the backend.

This is the last module before going on to the next track.

Know any way how to skip it and move on?

Michael Kolkebeck
Michael Kolkebeck
2,878 Points

Disregard the last question. I found that I can just take the next course off-track.