mardi 10 février 2015

Version 1.2 reflection EXC_BAD_ACCESS

Following code worked fine in 1.1 and stops working at the reflection reflect(a) in 1.2



class AClass {
var some : String = "Hans"
var thing : Double
init( t: Double ) {
thing = t
}
}

class BClass : AClass {

}

var a = BClass(t: 1.1)

var mirror = reflect(a) // FAILS
for var index=0; index<mirror.count; ++index {

}


Though reflect(a).valueType would work and in addition give more meaningfull output/information than before.


Which leads me to two questions:




  1. Does anybody know what changed with reflection? What could be wrong? Previously i could also iterate over the properties of the Object.




  2. Where can i inspect such changes? I don`t find anything about reflection in the offical documentation and there are no notes about reflection changes on the blog or anywhere else, can i browse the source somehow? (never tried)








Aucun commentaire:

Enregistrer un commentaire