Just a bit silly question and answered many times, but nevertheless i can't understand
while let element = enumdirs?.nextObject() as? String {
println(element)
}
The above causes error: Swift string doesn't conform to anyobject, so with as ,but
while let element = enumdirs?.nextObject() {
println(element as? String)
}
works perfectly. What the problem with casting in while statement