Objective-C: how to prevent abstraction leaks

Posted by iter on Stack Overflow See other posts from Stack Overflow or by iter
Published on 2010-03-30T00:55:53Z Indexed on 2010/03/30 1:03 UTC
Read the original article Hit count: 662

I gather that in Objective-C I must declare instance variables as part of the interface of my class even if these variables are implementation details and have private access.

In "subjective" C, I can declare a variable in my .c file and it is not visible outside of that compilation unit. I can declare it in the corresponding .h file, and then anyone who links in that compilation unit can see the variable.

I wonder if there is an equivalent choice in Objective-C, or if I must indeed declare every ivar in the .h for my class.

Ari.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about abstraction