0

I can't seem to find a way to do it. In Objective C it's possible using:

someInstance.class.SomeComputedClassVariable

I checked this question, but there's a compiler error stating Class_Name does not have a member named SomeComputedClassVariable, even though it is defined.

Community
  • 1
  • 1
nathan
  • 9,329
  • 4
  • 37
  • 51

2 Answers2

0

I found the answer, thanks to the mentioned post.

someInstance.dynamicType.SomeComputedClassVariable
Nic
  • 12,220
  • 20
  • 77
  • 105
nathan
  • 9,329
  • 4
  • 37
  • 51
0

You can also use reflect to get the class name of an instance:

class SomeClass {
}

println(reflect(SomeClass()).summary) 
Jason W
  • 13,026
  • 3
  • 31
  • 62