Hiding properties from public access

后端 未结 6 718
攒了一身酷
攒了一身酷 2020-12-07 22:53

I\'m trying to declare properties that are for internal use only in a Private category as such:

@interface BarLayer (Private)

@property (readwr         


        
6条回答
  •  不思量自难忘°
    2020-12-07 23:45

    Scott Stevenson (http://theocacao.com/) explains in his blog post "A Quick Objective-C 2.0 Tutorial: Part II" how to get Public Properties with Private Setters. Following his advice you will get a property that is read-only to the public, but has a private setter which can be used with the dot-syntax. Hope this helps...

提交回复
热议问题