how can you find out if an NSObject has a certain property?

Posted by strawtarget on Stack Overflow See other posts from Stack Overflow or by strawtarget
Published on 2010-06-17T05:10:12Z Indexed on 2010/06/17 5:13 UTC
Read the original article Hit count: 218

Let's say in Apple API version 1.0, there is a class NSFoo with a property 'color'. API 1.1 adds property 'size'.

I want to know whether I can use the getter: myFoo.size

[myFoo respondsToSelector:@selector(getSize)] doesn't work as expected.

What's the correct way to find out if an object has a property? Thanks!

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about properties