ccgus / CocoaScript

JavaScript + the Cocoa frameworks, and then ObjC brackets show up to party as well.
Other
618 stars 58 forks source link

How do you test for type in CocoaScript? #38

Closed corysimmons closed 8 years ago

corysimmons commented 8 years ago

And how do you type cast?

corysimmons commented 8 years ago

For others: you can test for type with log(typeof(myVariable));

ccgus commented 8 years ago

What are you trying to do specifically? If you've got an NSObject subclass, you can use isKindOfClass:

corysimmons commented 8 years ago

Thanks for your answers, but I'm done with Sketch plugin development.