Skip to content

Instantly share code, notes, and snippets.

@gothick
Created August 1, 2014 07:44
Show Gist options
  • Save gothick/4f08e7ecfe35a5e54cdb to your computer and use it in GitHub Desktop.
Save gothick/4f08e7ecfe35a5e54cdb to your computer and use it in GitHub Desktop.
protocol Testable{}
class MyObj : Testable{}
class Test {
var arr:[Testable] = []
func run() {
arr = [MyObj()] as [MyObj]
println("arr has \(arr.count) elements")
for e in arr { // following access causes EXC_BAD_ACCESS
println(e)
}
}
}
let t = Test()
t.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment