07-19-2023, 01:28 AM
The following code prints `nil`, despite `ListCell` is a valid class.
var lCellClass : AnyClass! = NSClassFromString("ListCell");
println(lCellClass);
The docs are saying that method returns
> The class object named by _aClassName_, or `nil` if no class by that name is currently loaded. If _aClassName_ is `nil`, returns `nil`.
I also tried to get `NSClassFromString()` of current viewcontroller which is LOADED but still get `nil`
What can be the problem ?
**Update:**
Even trying to do this `NSClassFromString("Array")` I still get `nil`
var lCellClass : AnyClass! = NSClassFromString("ListCell");
println(lCellClass);
The docs are saying that method returns
> The class object named by _aClassName_, or `nil` if no class by that name is currently loaded. If _aClassName_ is `nil`, returns `nil`.
I also tried to get `NSClassFromString()` of current viewcontroller which is LOADED but still get `nil`
What can be the problem ?
**Update:**
Even trying to do this `NSClassFromString("Array")` I still get `nil`