Skip to content

Comment on First Glance at Objective-C and the iPhone SDK (by a Java and C Developer)parent

Comments

You can use @public, @private, or @protected on the instance variables. Unfortunately these do not extend to the properties themselves and you have to use a different approach as in the sibling comment:

  @interface SomeClass (SomePrivateCategory)
     @property (nonatomic, assign) NSUInteger count;
     ...
  @end

Actually, Objective-C has class extensions for just this purpose. No need for a private category.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.