ios - How to check if an id points to a CGRect? -


supposing have:

id value = [self valueforkey:@"frame"]; bool valueiscgrect = ???; 

how can decide? should cast id something?

the returned value of type nsvalue scalar types, provides method objctype, returns encoded type of wrapped scalar type. can use @encode() encoding arbitrary type, , compare objctype.

if(strcmp([value objctype], @encode(cgrect)) == 0) {    // it's cgrect } 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -